Oké. I just tested it myself. Did take a while because i don’t have the webserver enabled and had no devices configured, because i don’t use the pilight gui. And i also don’t see the state changes. I think it is because when you send a code only the sender is used to send the code, the receiver doesn’t listen for that code. So it is not an received code and HA won’t change the state. If you were using a remote for example then the code would have been received by Pilight and thus also by HA.
But may i ask why you want to use the pilight webgui, in my opinion it looks not that nice ?
Its not the Web Gui I want to use. Its because at this moment, I configured pilight to work with homebridge and the Pilight iOS app pilightControll (which also use the Pilight API and state changes work well) and it is the same problem. At this moment all config is done in the pilight config.json. I have a lot of devices added and I try to test Home-Assistant.
I guess there a must be a way see the state changes in HA because the API can do this.
Edit
And I thought the Pilight API delivers all device information. So I’m little confused that I have to add Protocol, ID, Unid…to Home-Assistant.
No problem! I didn’t know you could set up pilight to work with homebrige. I have Home-Assistant setup with homebridge.
But there’s always a way to make it work, but i’m afraid i can’t help you with it. (above my knowledge )
Yeah i read the pilight api can do that, but i don’t think it is used for home assistant, because that means you have to setup everything in pilight and keep maintaining it. (for you it would have been great, but for people who want to have everything in one place this way is better because you only have to configure it within home assistant.
I added HA to homebridge, too.
But at this moment HA runs on a Mac Mini Server and Pilight and Homebridge on the Raspberry Pi 1. I hope, after a little HA practice I can switch completely to HA and I runs this on a Pi 3.
Thanks for the help
Anybody having this error after uprading to 0.32.1 :
16-11-06 11:30:35 homeassistant.components.switch: Error while setting up platform pilight
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 148, in _async_setup_platform
entity_platform.add_entities, discovery_info
File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/switch/pilight.py", line 63, in setup_platform
properties.get(CONF_OFF_CODE_RECIEVE)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/switch/pilight.py", line 84, in __init__
if any(self._code_on_receive) or any(self._code_off_receive):
TypeError: 'NoneType' object is not iterable
Now I see the Toggle in HA, but nothing happened if I switch on/off.
No pilight errors logged
Can you pls look, if its possible to get a stat receive, if the switch are configured in the Pilight config.cfg ?
Auto discovery switch would be realy nice, too. The Pilight API can do this.
I did some checking and figured out this:
I changed the following:
/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/pilight.py
SWITCHES_SCHEMA = vol.Schema({
vol.Required(CONF_ON_CODE): COMMAND_SCHEMA,
vol.Required(CONF_OFF_CODE): COMMAND_SCHEMA,
vol.Optional(CONF_NAME): cv.string,
vol.Optional(CONF_OFF_CODE_RECIEVE, default={}): COMMAND_SCHEMA,
vol.Optional(CONF_ON_CODE_RECIEVE, default={}): COMMAND_SCHEMA,
The component loads but still the switches don’t work. The message says json
{‘protocol’: [‘kaku_switch_old’], ‘unit’: 1, ‘id’: 1, ‘on’: 1}
But when i test a pilight send service with:
{“protocol”: [“kaku_switch_old”], “unit”: 1, “id”: 1, “on”: 1}
it does work
It looks like the issue is in the json it is sending to the pilight deamon. But this is as far as my knowledge goes.
Please do not forget that the github repository is meant for issues. I created a new issues. In the forum the issues might not be seen.
I created a quick hotfix, thus the pilight switch will hopefully start working again in release 0.32.2.
The message says json {‘protocol’: [‘kaku_switch_old’], ‘unit’: 1, ‘id’: 1, ‘on’: 1}
But when i test a pilight send service with: {“protocol”: [“kaku_switch_old”], “unit”: 1, “id”: 1, “on”: 1}
it does work
i’m also new to HA and Pilight and want to install both on one Pi (my RPi Zero W). Hass.io is running fine, but what do i have to do to install Pilight? I read some posts above, that you have to install it from source. What does that mean (sorry, I’m a newbie ) Is installing pilight from source described at the end of this guide? http://manual.pilight.org/installation.html
Just seen this and thought I’d answer it tho’ you probably know by now, the on/off_code_receive is for when you have a remote that is switching the target on/off, it means HA and the target stay in sink when a remote is used.