What is the Webserver used for?

  • Viewing the temperature reading in celcius
  • Retrieving the temperature reading for you own custom application
  • Updating the firmware
  • Looking at the Logs


Access the Webserver

  • Once your Firefly Temperature Sensor is connected to your local WiFi network, the webserver will be accessible by any browser. Find the local IP address of your Firefly Temperature Sensor. This can be found by accessing your router to find the assigned IP address. Most IPs start with 192.168.x.x or 10.0.x.x


  • Open your browser and type in the local IP in the address bar. You will be prompted with a username and password. The password is unique to your device. Your password is the device ID. The device ID is the last numbers in the device name. Your device name can be found by looking in Home Assistant or by looking for it on your WiFi router. The device name format is "Firefly_Temp_Sensor_xxxxxx". The last digits will be the password. The username is "firefly".


  • Once you log in, you will be able to see the current temperature reading in celcius. The web page also has a section where you can view the logs. Updating the firmware is also possible on this web page by uploading the .bin file from github.


 


Use the API

  • Now that you know the local IP address and username/password, you will be able to use a get command to retrieve the current temperature reading. 


  • Build your URL like this example by replacing the localIP and deviceID with the properties from your temperature sensor. You can use a program like Postman to test that you have the correct settings. 
GET http://{localIP}:80/sensor/firefly_temp_sensor_{deviceID}


  • The response from the webserver will be in a JSON format like this;
{
    "id": "sensor-firefly_temp_sensor_xxxxxx",
    "state": "22.0 °C",
    "value": 22.01278
}


  • Once this is working, you will be able to use this for your own custom application by parsing the JSON response.