HA looses connection to pilight every few hours

Hi,
I’m currently using HA 0.44.2 and pilight 7…

If anyone else is using pilight do you have a problem where HA looses the connection and so can’t control anything, it’s very frustrating indeed :frowning: I can use the pilight web gui fine but HA not a bit of it until I restart HA which takes five minutes, it’s driving me up the wall :frowning: It happen at least once a day sometimes more often. I don’t see anything unusual in the logs, except the usual pilight errors related to individual switches…

I get lots of these…
2017-06-12 19:33:48 ERROR (Thread-6) [custom_components.light.magicbluelight] Could not connect to the MagicBlue C1:40:5D:6E:A3:E8
2017-06-12 19:35:13 ERROR (Thread-10) [homeassistant.components.pilight] Pilight send failed for {‘unit’: 1, ‘on’: 1, ‘protocol’: [‘arctech_switch_old’], ‘id’: 31}
2017-06-12 19:35:19 ERROR (Thread-7) [homeassistant.components.pilight] Pilight send failed for {‘unit’: 15, ‘protocol’: [‘arctech_switch_old’], ‘id’: 30, ‘off’: 0}
2017-06-12 19:35:19 ERROR (Thread-10) [homeassistant.components.pilight] Pilight send failed for {‘unit’: 1, ‘protocol’: [‘arctech_switch_old’], ‘id’: 31, ‘off’: 0}
2017-06-12 19:35:19 ERROR (Thread-6) [homeassistant.components.pilight] Pilight send failed for {‘unit’: 5, ‘protocol’: [‘arctech_switch_old’], ‘id’: 23, ‘off’: 0}

but I don’t think they are related to the main problem as while I get these I can switch on/off switches and lights from HA.

Anyone have any ideas?

I think that the pilight interface hass uses is different to the web gui, thus one can work and the other not. Maybe you can start pilight with debug logging to get some insight what happens?

Hi David,

I’ve got HA setup to log debug but have not tried pilight yet. I’ll give it a go and report back.

pilight Web GUI that works…
[Jun 13 16:55:43:445085] pilight-daemon: DEBUG: socket recv: {“action”:“control”,“code”:{“device”:“pilivingroomchargestation”,“state”:“on”}}
[Jun 13 16:55:43:445571] pilight-daemon: DEBUG: **** RAW CODE ****
[Jun 13 16:55:43:445638] pilight-daemon: DEBUG: socket write succeeded: {“status”:“success”}

335 1005 1005 335 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 1005 335 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 1005 335 335 1005 1005 335 335 1005 1005 335 335 11390
[Jun 13 16:55:43:445748] pilight-daemon: DEBUG: **** RAW CODE ****
[Jun 13 16:55:43:894591] pilight-daemon: DEBUG: successfully send arctech_switch_old code
[Jun 13 16:55:43:895834] pilight-daemon: DEBUG: socket write succeeded: {“origin”:“update”,“type”:1,“devices”:[“pilivingroomchargestation”],“values”:{“timestamp”:1497372943,“state”:“on”}}

[Jun 13 16:55:43:895903] pilight-daemon: DEBUG: broadcasted: {“origin”:“update”,“type”:1,“devices”:[“pilivingroomchargestation”],“values”:{“timestamp”:1497372943,“state”:“on”}}
[Jun 13 16:55:43:896147] pilight-daemon: DEBUG: socket write succeeded: {“origin”:“update”,“type”:1,“devices”:[“pilivingroomchargestation”],“values”:{“timestamp”:1497372943,“state”:“on”}}

[Jun 13 16:55:43:896194] pilight-daemon: DEBUG: broadcasted: {“origin”:“update”,“type”:1,“devices”:[“pilivingroomchargestation”],“values”:{“timestamp”:1497372943,“state”:“on”}}
[Jun 13 16:55:43:896422] pilight-daemon: DEBUG: socket write succeeded: {“origin”:“sender”,“protocol”:“arctech_switch_old”,“message”:{“id”:1,“unit”:1,“state”:“on”},“repeat”:1,“uuid”:“0000-b8-27-eb-e9a067”}

[Jun 13 16:55:43:896476] pilight-daemon: DEBUG: broadcasted: {“origin”:“sender”,“protocol”:“arctech_switch_old”,“message”:{“id”:1,“unit”:1,“state”:“on”},“repeat”:1,“uuid”:“0000-b8-27-eb-e9a067”}

HA when it does work…

[Jun 13 16:52:06:412363] pilight-daemon: DEBUG: broadcasted: {“values”:{“cpu”:10.2883749573888466,“ram”:1.1534906492552748},“origin”:“core”,“type”:-1,“uuid”:“0000-b8-27-eb-e9a067”}
[Jun 13 16:52:06:757719] pilight-daemon: DEBUG: socket recv: {“code”: {“off”: 0, “protocol”: [“kaku_switch_old”], “unit”: 1, “id”: 1}, “action”: “send”}
[Jun 13 16:52:06:758402] pilight-daemon: DEBUG: **** RAW CODE ****
[Jun 13 16:52:06:758431] pilight-daemon: DEBUG: socket write succeeded: {“status”:“success”}

335 1005 1005 335 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 1005 335 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 1005 335 335 1005 1005 335 335 1005 335 1005 335 11390
[Jun 13 16:52:06:758650] pilight-daemon: DEBUG: **** RAW CODE ****
[Jun 13 16:52:07:209875] pilight-daemon: DEBUG: successfully send arctech_switch_old code
[Jun 13 16:52:07:211654] pilight-daemon: DEBUG: socket write succeeded: {“origin”:“update”,“type”:1,“devices”:[“pilivingroomchargestation”],“values”:{“timestamp”:1497372727,“state”:“off”}}

[Jun 13 16:52:07:211741] pilight-daemon: DEBUG: broadcasted: {“origin”:“update”,“type”:1,“devices”:[“pilivingroomchargestation”],“values”:{“timestamp”:1497372727,“state”:“off”}}
[Jun 13 16:52:07:212175] pilight-daemon: DEBUG: socket write succeeded: {“origin”:“update”,“type”:1,“devices”:[“pilivingroomchargestation”],“values”:{“timestamp”:1497372727,“state”:“off”}}

[Jun 13 16:52:07:212231] pilight-daemon: DEBUG: broadcasted: {“origin”:“update”,“type”:1,“devices”:[“pilivingroomchargestation”],“values”:{“timestamp”:1497372727,“state”:“off”}}
[Jun 13 16:52:07:212627] pilight-daemon: DEBUG: socket write succeeded: {“origin”:“sender”,“protocol”:“arctech_switch_old”,“message”:{“id”:1,“unit”:1,“state”:“off”},“repeat”:1,“uuid”:“0000-b8-27-eb-e9a067”}

[Jun 13 16:52:07:212805] pilight-daemon: DEBUG: socket write succeeded: {“origin”:“sender”,“protocol”:“arctech_switch_old”,“message”:{“id”:1,“unit”:1,“state”:“off”},“repeat”:1,“uuid”:“0000-b8-27-eb-e9a067”}

[Jun 13 16:52:07:212856] pilight-daemon: DEBUG: broadcasted: {“origin”:“sender”,“protocol”:“arctech_switch_old”,“message”:{“id”:1,“unit”:1,“state”:“off”},“repeat”:1,“uuid”:“0000-b8-27-eb-e9a067”}
[Jun 13 16:52:09:414027] pilight-daemon: DEBUG: cpu: 4.411341%, ram: 1.153491%
[Jun 13 16:52:09:414641] pilight-daemon: DEBUG: socket write succeeded: {“values”:{“cpu”:4.4113414395396999,“ram”:1.1534906492552748},“origin”:“core”,“type”:-1,“uuid”:“0000-b8-27-eb-e9a067”}

[Jun 13 16:52:09:414707] pilight-daemon: DEBUG: broadcasted: {“values”:{“cpu”:4.4113414395396999,“ram”:1.1534906492552748},“origin”:“core”,“type”:-1,“uuid”:“0000-b8-27-eb-e9a067”}
[Jun 13 16:52:09:552732] pilight-daemon: DEBUG: socket recv: {“code”: {“protocol”: [“kaku_switch_old”], “unit”: 1, “id”: 1, “on”: 1}, “action”: “send”}
[Jun 13 16:52:09:553428] pilight-daemon: DEBUG: socket write succeeded: {“status”:“success”}

[Jun 13 16:52:09:553434] pilight-daemon: DEBUG: **** RAW CODE ****
335 1005 1005 335 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 1005 335 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 335 1005 1005 335 335 1005 1005 335 335 1005 1005 335 335 11390
[Jun 13 16:52:09:553699] pilight-daemon: DEBUG: **** RAW CODE ****
[ Jun 13 16:52:10:2482] pilight-daemon: DEBUG: successfully send arctech_switch_old code
[ Jun 13 16:52:10:4018] pilight-daemon: DEBUG: socket write succeeded: {“origin”:“update”,“type”:1,“devices”:[“pilivingroomchargestation”],“values”:{“timestamp”:1497372730,“state”:“on”}}

[ Jun 13 16:52:10:4090] pilight-daemon: DEBUG: broadcasted: {“origin”:“update”,“type”:1,“devices”:[“pilivingroomchargestation”],“values”:{“timestamp”:1497372730,“state”:“on”}}
[ Jun 13 16:52:10:4499] pilight-daemon: DEBUG: socket write succeeded: {“origin”:“update”,“type”:1,“devices”:[“pilivingroomchargestation”],“values”:{“timestamp”:1497372730,“state”:“on”}}

[ Jun 13 16:52:10:4551] pilight-daemon: DEBUG: broadcasted: {“origin”:“update”,“type”:1,“devices”:[“pilivingroomchargestation”],“values”:{“timestamp”:1497372730,“state”:“on”}}
[ Jun 13 16:52:10:4935] pilight-daemon: DEBUG: socket write succeeded: {“origin”:“sender”,“protocol”:“arctech_switch_old”,“message”:{“id”:1,“unit”:1,“state”:“on”},“repeat”:1,“uuid”:“0000-b8-27-eb-e9a067”}

[ Jun 13 16:52:10:5096] pilight-daemon: DEBUG: socket write succeeded: {“origin”:“sender”,“protocol”:“arctech_switch_old”,“message”:{“id”:1,“unit”:1,“state”:“on”},“repeat”:1,“uuid”:“0000-b8-27-eb-e9a067”}

[ Jun 13 16:52:10:5146] pilight-daemon: DEBUG: broadcasted: {“origin”:“sender”,“protocol”:“arctech_switch_old”,“message”:{“id”:1,“unit”:1,“state”:“on”},“repeat”:1,“uuid”:“0000-b8-27-eb-e9a067”}

Just have to wait for it to fail now…

OK, nothing in the pilight log when HA fails do any commands

Interessting. I guess you have pilight not installed on the hass pc? Could this be a network issue? A usefull feature I guess is to do a frequent heart beat. Unfortunately I have no time right now to implement this feature, but I add this to my TODO list.

Hi David,
pilight and HA are installed on the same PI3 so it is not an issue with my network.Thanks for the update, please keep us informed when you implement the new heatbeat feature, is there anything I can do to try to debug this for you? or maybe set up an automation that toggles a light every few minutes to see if it makes a difference?