From AppleWatch |
In this post NodeRed(NR) is retrieving the temperature from Your selected source and is also acting as the WEB endpoint for the HB "homebridge-http-temperature" plugin.
In my case I wanted an outside temperature so used the measurements from our Davis Weather station and their JSON REST API but it could for example be Your Raspberry CPU temp or showing the speed of Your Internet connection.
In the NR flow example the temperatures are retrieved from flow context. So add Your own logic retrieving Your temperatures, at chosen intervals, and update the flow context "temp1" and "temp2".
Install the "homebridge-http-temperature" plugin and setup the config looking like below. The URL:s are referring to the endpoints You just set up in NR. Changed so the hostname, "home", matches Your setup.
"accessories": [
{
"accessory": "HttpTemperature",
"name": "Temp outside1",
"url": "http://home:1880/temp1",
"http_method": "GET",
"field_name": "Temperature"
},
{
"accessory": "HttpTemperature",
"name": "Temp outside2",
"url": "http://home:1880/temp2",
"http_method": "GET",
"field_name": "Temperature"
}
]
{
"accessory": "HttpTemperature",
"name": "Temp outside1",
"url": "http://home:1880/temp1",
"http_method": "GET",
"field_name": "Temperature"
},
{
"accessory": "HttpTemperature",
"name": "Temp outside2",
"url": "http://home:1880/temp2",
"http_method": "GET",
"field_name": "Temperature"
}
]
Restart HomeBridge and check the result in Your Home app.
There are other HomeBridge temperature http plugins available, also handling humidity, so just Google with "homebridge temperature http" or using NPM.
This worked perfectly for grabbing the current temperature from my Cumulus MX server running on a Pi, which offers a GET API endpoint (returns JSON). Thank you for the tutorial! This Homebridge newbie appreciates it.
ReplyDeleteThanks ! Since you using Davis weather station check this https://pysselilivet.blogspot.com/2017/01/install-weather34-with-weatherlink.html
Delete