I wrote a python script that reads ruuvitag (http://ruu.vi) transmissions and returns desired values to command line.
I am able to add single command line sensor and everything works fine. But as soon as I add another (same ruuvitag but humidity or pressure for example, or whole another ruuvitag), web interface does not work. Connections are not accepted. Only error in logfile is 10 sec timeout or similar.
Any ideas?
Alternatively I tired to do it with this:
but got always error with my configuration at the row where it reads "sensors: " and was unable to find reason why. Got following error:
mapping values are not allowed in this context at line
What did I get wrong with this?
I am more than happy to share python files and similar through github as soon as I get my own setup working.
Thanks for the reference, that helped a lot when tracking down possible issues.
It seems that calling same command multiple times causes the issue. Or then my script just does not work as supposed to when it is running multiple instances at the same time.
The logic for it is following: you call for specific sensor by MAC and either specify measurements you want
ruuvi-hass.py AA:BB:CC:DD:EE:FF temp
And output:
12.0
Temperature in degrees
Or
ruuvi-hass.py AA:BB:CC:DD:EE:FF
And output:
12.0:1005:54
Temp:pressure:humidity %
So if I poll same sensor with two separate queries or two different sensors, something breaks down and web interface can not be accessed.
platform: command_line
name: sisalla
command: “/home/homeassistant/ruuvi-hass2.py FF:EE:DD:CC:BB:AA temp” ← this works
command: “/home/homeassistant/ruuvi-hass/ruuvi-hass.py FF:EE:DD:CC:BB:AA temp” ← this not
unit_of_measurement: “°C”
If I make a copy of the python script and put it elsewhere and access other sensor through it, web interface works again.
I got finally that split setting working and now single commmand line executable returns all possible sensor values to single sensor and its content is split to specific sensors.
Or it might do that, not sure because web ui does not open.
So no matter how I do it. Either by multiple instances of same command (each calls for listening different bt MAC broadcast) or dump all values to single sensor and use templates to separate desired values to new sensors. Web UI gets disabled anyway.
No errors at error log. Based on hass outputs, all seems to work.
Script is working fine. Data format: s1temp:s1humidity:s1pressure:s2temp:s2humidity:s2pressure:
Even when the setup started to work eventually, it is still frustrating.
Could this be delay to web ui starting later on?
Yesterday evening it did not work. This morning it did not work. But there was power outage during the day and now everything is working like it is supposed to. I am pretty confused what is causing this seemingly random misbehaviour.