Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Wireless tags platform #13495
This PR introduces support of Wireless Sensor Tag sensors in HASS.
Each metric type supplements with switch which allows to
Each metric type provides extensive set of events represented by this implementation as binary sensor states. It includes
All binary sensor states are received by defining
The implementation is tested on 3 different types of actual wirelesstag hardware including:
So far it looks like current implementation depends on presence of binary sensors config, otherwise local push is not installed. I'm not sure how to resolve it as I don't know (at the moment) how to determine if specific part of platform (sensors or binary_sensors) were initialized being at main entry to platform setup.
Thank you )
Example entry for
@tube0013 - I've used tag's manager API which allows to install custom URL call for specific events in tag. So I defined local push notifications as POST request to hass instance with defined by me payload as json with parameters filled by tag manager. I specified 'nat' parameter as true for tag manager that made them local (so I can use local ip address of hass). To receive these notifications, I defined two custom events (and corresponding event handlers) in hass (see homeassistant/components/wirelesstag.py lines 197, 198).
where: http://192.168.1.50:8123 is ip:port of hass.
Please note - to make it working you need to whitelist the IP of your tag manager in HASS http configuration. Also you need to add at least one binary sensor in config.
Does it help? ;)
@sergeymaysak thank you, this makes perfect sense. I was not able to get the component to load in my hassio install. I'll keep trying as time allows, I don't think this PR is the place for this continues discussion though. - if you have another place that works better let me know-
I have all sensor/binary_sensor/switch wirelesstag.py files in the corresponding directories under custom_components, and I have the componet wirelesstag.py in the root of custom_components.
@tube0013 actually, the intent of this PR is to avoid need of custom_component setup :) (from hass 0.67 i hope), but meanwhile to allow your custom setup you need to adjust
enjoy and any comments/concerns are welcome ;)
@sergeymaysak okay thank you, that got it running. I do get this error on my frontend:
the tag manager didn't let me use https for my call back url. so I'm am I right to assume this won't work locally if my HA instance is using https?
@sergeymaysak yes once you add the certificates to the http component HASS is now over https. I reconfigured my set up to put caddy in front of hass and handling the ssl, so hass can be accessed over http from inside my lan now. - how can I be sure local updates from the tag manager are working?
Also wirelesstag is reporting temperature values in Celsius only, HA can do the conversion to F if set to imperial units. The rest api sends the temps in C as well, and HA displays them in F for me. Your code looks to be assuming they are coming in F.
so the temp is showing as 20.1 F but is really 20.1 C, and should read ~68.05 F
@sergeymaysak one other observation now that I mostly got this running, HA doesn't seem to like it if there is white space in the Tag names it gets from wirelesstag. I was getting errors about invalid entity names. I replaced all the space with underscores in my tag names, and now I'm not seeing the errors. Here is an example of the error I was getting:
@tube0013 Thanks for observations! I've updated my code to proper handling of unit_system: imperial. Additionally I've updated name of
Jun 7, 2018
@sergeymaysak question RE local tag URL calling.
I se the url calling on the wireless tag site to use my local ip address. for sensors:
and binary sensors:
this works for a few hours, then I go back and check and the urls have been re-written to my outside domain name which will not work over http...
All sensors get changed to:
Some Binary Sensors get changed to:
I'm not sure why this is happening, and know it makes the local url calling not work.