Home Assistant release with the issue:
arch x86_64
dev false
docker true
hassio true
os_name Linux
python_version 3.7.3
timezone Europe/London
version 0.92.2
virtualenv false
Lovelace
mode storage
resources 6
views 10
Last working Home Assistant release (if known):
0.89
Operating environment (Hass.io/Docker/Windows/etc.):
Hassio 0.92.2 in Docker with Proxmox.
Component/platform:
Canary -- the auto discovered sensors (temp, humidity, air quality)
https://www.home-assistant.io/components/canary/
Description of problem:
Canary camera component sensors (temp, humidity and air quality) have stopped working. I believe they were last working with 0.90.
Camera feed from Canary still works and the sensor for alarm_control_panel still displays correctly.
Problem-relevant configuration.yaml entries:
logger:
logs:
homeassistant.components.canary: debug
canary:
username: !secret canary_username
password: !secret canary_passwd
Additional information:
I've posted an issue on the HA community forum and others are experiencing the same issue.
Please use the issue template.
I have the same behaviour.
Still broken in HomeAssistant 0.93.
Just my luck, just got a canary and its not given me the sensors
Still an issue in 0.94.3.
As a workaround I have created a python script to read Canary sensor data.
This works for me as a command line sensor. (This does not handle multiple canary devices, and I only tested with my canary all-in-one, so this is a usual as-is tool, but I welcome any feedback)
https://github.com/pipacsba/Canary_sensor_read
I do not have the know-how to double check this implementation with the home assistant's canary component, but if someone can, I would be glad to drop this tool. (As I see the component is somehow using a different api interface than this script)
@pipacsba Great stuff!!
Just tested and all good. Gets me out of an annoying situation. I only have one all-in-one so can't really test beyond that
Sensors still not showing up in 0.95.4
@pipacsba How can I use your script? I'm with a docker home assistant
@pipacsba How can I use your script? I'm with a docker home assistant
Hi @CeccoCQ : you can use it as a command line sensor component. It is important to place the files to somewhere where HASS hac access it (I do not have experience with Docker, but I placed them to the homeassistant/scripts folder, I would guess that should be accessible on docker, too). Also fill the conf file, and rename it to Canary.conf (if you place it to an other folder than the scripts, than please update the read_sensor_data.py line 12 with the correct path, too). I hope it helps.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 馃憤
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
This issue is still persistent in HomeAssistant 0.101.0
@pipacsba this script is awesome thanks for this! Any direction on why the script runs fine from the host if I run it manually but returns no values/data in homeassistant?
@snipes040 well, the first thing I would check is the ownership of the two files.
@pip
@snipes040 well, the first thing I would check is the ownership of the two files.
Ah ok so I checked the ownership and it's my user that has ownership, I also double checked that I updated the paths in the script.
@snipes040 sorry, I was not clear enough, the homeassistant needs to be able to execute the script. the homeassistant user shall have the right to read/execute.
@pipacsba ah ok so I suppose it's worth mentioning that I'm on docker, so what user would I use though? I'm using a created admin user, lets call this user "john" and that user has full access on those scripts. I assume I'm missing something? I should also maybe mention that homeassistant doesn't even see the script under the "Create and edit scripts" option on the frontend.
@snipes040 sorry, I know nothing about docker... I would still verify that the user which owns the homeassistant process can execute the script, or the docker sees the paths differently, but I am just wild guessing here. My script is not a homeassistant script, so it is fine that homeassistant gui does not show it.
@pipacsba Awesome thanks for replying and your help! I still haven't figured it out yet but it's strange that in the homeassistant log shows this error:
[homeassistant.components.command_line.sensor] Command failed: python3 /home/home-assistant/scripts/read_sensor_data.py
2019-11-22 15:25:35 WARNING (SyncWorker_13) [homeassistant.components.command_line.sensor] Empty reply found when expecting JSON data
@snipes040 I am still stucked with the ownership question, as you say that if you run the script from command line, than you get results, but no data if home assistant tries to execute it. Could you please run the following commands (of course update the path correctly):
stat -c %U /path/to/home-assistant.log
stat -c %U /path/to/read_sensor_data.py
for me both results with "homeassistant". If it gives different result for the two files, could you change both of the script's *.py ownership to be same as of the log file?
Or make sure that the .py files have permission set for rwxr-xr-x (0755).
If the permissions are ok, could you check if you run the script than you get a result similar to:
{
"air_quality": "0.643607368494602",
"humidity": "56.763079947613654",
"read_ok": true,
"temperature": "23.034022250074017"
}
@snipes040 I am still stucked with the ownership question, as you say that if you run the script from command line, than you get results, but no data if home assistant tries to execute it. Could you please run the following commands (of course update the path correctly):
stat -c %U /path/to/home-assistant.log
stat -c %U /path/to/read_sensor_data.py
for me both results with "homeassistant". If it gives different result for the two files, could you change both of the script's *.py ownership to be same as of the log file?
Or make sure that the .py files have permission set for rwxr-xr-x (0755).
If the permissions are ok, could you check if you run the script than you get a result similar to:
{
"air_quality": "0.643607368494602",
"humidity": "56.763079947613654",
"read_ok": true,
"temperature": "23.034022250074017"
}
Thanks pipacsba for replying! I can run the command as my docker host user but still getting the error in homeassistant. I agree that it looks to be a permission issue but I don't see where the homeassistant user is on my docker system or how to add rwx for the homeassistant user. I'll have to keep digging into this. Thanks a lot for you help though it has been much appreciated!!
I'm facing the same issue in 0.105.3.
I have just set up the Canary integration but I have no sensors showing up.
I have tried the python script by @pipacsba, but I get the same error commented by @snipes040 with the Command failed and Empty reply found when expecting JSON data.
I have copied the folder to custom_components in my HomeAssistant folder, changing the referencing lines on the read_sensor_data.py file and the sensor template code. Canary.conf is also configured with the correct information.
@snipes040 did you fix your issue with this?
@EDV11 I never figured it out either it still gives the same error but when I run the command locally it works perfectly fine. Not sure if it's because I'm on docker or not but I gave up trying to get it to work.
@EDV11 @pipacsba So I figured out the issue kind of. I spun up a VENV HA instance and the canary script works perfectly fine. I came across this when trying to do some command_line sensors and they didn't work either from HA. It's something to do with the docker container not having the correct access/permissions I think but this is beyond my understanding. Just and FYI.
Most helpful comment
Sensors still not showing up in 0.95.4