Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MQTT connection to HomeAssistant not working
#10
(01-25-2017, 11:17 AM)admin Wrote: thanks, when i was reading the docs, i found only the MQTT method but not hte HTTP Smile
i will add it.
currently there is no support for arbitrary headers just the content type, i will add also an option to specify generic headers
here is how currently the custom HTTP config has to look like for more details
{"method":"POST","url":"http://things.ubidots.com/api/v1.6/devices/dsds?token=sadssads","ct":"application/json","pay":"{\"sdsd\":%TEMP%}"}

The extra header is only required, if access to HomeAssistant is password protected.

I was trying it out and it immediately worked  Smile

With this http requests, sensor values will immediately show up in HomeAssistant, without any need for a MQTT broker:

Code:
{"method":"POST","url":"http://<home-assistant-host>:8123/api/states/sensor.vair_dust10","ct":"application/json","pay":"{\"state\": \"%PM10%\", \"attributes\": {\"unit_of_measurement\": \"\", \"friendly_name\": \"Staub(10)\"}}"}
{"method":"POST","url":"http://<home-assistant-host>:8123/api/states/sensor.vair_dust25","ct":"application/json","pay":"{\"state\": \"%PM25%\", \"attributes\": {\"unit_of_measurement\": \"\", \"friendly_name\": \"Staub(25)\"}}"}
{"method":"POST","url":"http://<home-assistant-host>:8123/api/states/sensor.vair_co2","ct":"application/json","pay":"{\"state\": \"%CO2%\", \"attributes\": {\"unit_of_measurement\": \"ppm\", \"friendly_name\": \"CO2 Gehalt\"}}"}
{"method":"POST","url":"http://<home-assistant-host>:8123/api/states/sensor.vair_temp","ct":"application/json","pay":"{\"state\": \"%TEMP%\", \"attributes\": {\"unit_of_measurement\": \"C\", \"friendly_name\": \"Temperatur\"}}"}
{"method":"POST","url":"http://<home-assistant-host>:8123/api/states/sensor.vair_humidity","ct":"application/json","pay":"{\"state\": \"%HUM%\", \"attributes\": {\"unit_of_measurement\": \"%\", \"friendly_name\": \"Luftfeuchtigkeit\"}}"}

   
Big Grin

This might be something to add to the documentation.
Reply


Messages In This Thread
RE: MQTT connection to HomeAssistant not working - by code_talker - 01-26-2017, 10:11 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)