Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Insteon dual wall outlet #48

Closed
djfjeff opened this issue Mar 13, 2018 · 10 comments
Closed

Support Insteon dual wall outlet #48

djfjeff opened this issue Mar 13, 2018 · 10 comments

Comments

@djfjeff
Copy link

djfjeff commented Mar 13, 2018

Hi,

I tried adding my Insteon dual wall outlet (https://www.insteon.com/on-off-outlet/) and I cannot seems to be able to control both the top and botton outlet with mqtt.

In the config.yaml, it says to add the outlet as a switch but after that, I see nowhere on how to make the distinction to use the top or botton outlet.

Would it be possible to add this feature?

@djfjeff
Copy link
Author

djfjeff commented Mar 13, 2018

It also seems impossible to adjust the status LED brightness on the dual wall switch. Running the command simply has no effect on the LED.

@TD22057
Copy link
Owner

TD22057 commented Mar 13, 2018

I found the dev guide: http://cache.insteon.com/developer/2663-222dev-062014-en.pdf
So it should be simple to follow that and get it in. FYI I don't have a lot of time right now but I'll try and look at it in a few weeks.

@djfjeff
Copy link
Author

djfjeff commented Mar 13, 2018

I took a look and it seems that it only need 0x02 in the command2 field. I will try to see what I can do when I have a moment, my python is somewhat far for me ;)

TD22057 added a commit that referenced this issue Apr 1, 2018
@TD22057
Copy link
Owner

TD22057 commented Apr 1, 2018

OK - first cut at this is done and on the dev branch. Please give it a try - I don't have any outlets to test with (I tested w/ a lamp module and it seems to do what I want). You'll need update your config file (new outlet inputs for insteon and mqtt) and run a pair to get both group links defined.

Please let me know if works when you have time to test it.

@djfjeff
Copy link
Author

djfjeff commented Apr 3, 2018

@TD22057 it does not seems to work. When I press the off button in HASS to turn off an already on outlet, insteon-mqtt completely crash with the following :

2018-04-03 09:05:36 DEBUG Outlet: Outlet btn 1 message insteon/34.a1.xx/set/1 b'OFF'
2018-04-03 09:05:36 DEBUG MsgTemplate: Input template render: '{ "cmd" : "off" }'
2018-04-03 09:05:36 INFO Outlet: Switch input command: {'cmd': 'off'}
2018-04-03 09:05:36 INFO Outlet: Outlet False grp: 34.a1.xx cmd: on
Traceback (most recent call last):
File "/opt/DEV2-insteon-mqtt/DEV2-insteon-mqtt-venv/bin/insteon-mqtt", line 5, in
status = insteon_mqtt.cmd_line.main()
File "/opt/DEV2-insteon-mqtt/DEV2-insteon-mqtt-venv/lib64/python3.6/site-packages/insteon_mqtt/cmd_line/main.py", line 272, in main
return args.func(args, cfg)
File "/opt/DEV2-insteon-mqtt/DEV2-insteon-mqtt-venv/lib64/python3.6/site-packages/insteon_mqtt/cmd_line/start.py", line 52, in start
loop.select()
File "/opt/DEV2-insteon-mqtt/DEV2-insteon-mqtt-venv/lib64/python3.6/site-packages/insteon_mqtt/network/poll.py", line 211, in select
if link.read_from_link() == -1:
File "/opt/DEV2-insteon-mqtt/DEV2-insteon-mqtt-venv/lib64/python3.6/site-packages/insteon_mqtt/network/Mqtt.py", line 221, in read_from_link
status = self.client.loop_read()
File "/opt/DEV2-insteon-mqtt/DEV2-insteon-mqtt-venv/lib64/python3.6/site-packages/paho/mqtt/client.py", line 1284, in loop_read
rc = self._packet_read()
File "/opt/DEV2-insteon-mqtt/DEV2-insteon-mqtt-venv/lib64/python3.6/site-packages/paho/mqtt/client.py", line 1849, in _packet_read
rc = self._packet_handle()
File "/opt/DEV2-insteon-mqtt/DEV2-insteon-mqtt-venv/lib64/python3.6/site-packages/paho/mqtt/client.py", line 2305, in _packet_handle
return self._handle_publish()
File "/opt/DEV2-insteon-mqtt/DEV2-insteon-mqtt-venv/lib64/python3.6/site-packages/paho/mqtt/client.py", line 2500, in _handle_publish
self._handle_on_message(message)
File "/opt/DEV2-insteon-mqtt/DEV2-insteon-mqtt-venv/lib64/python3.6/site-packages/paho/mqtt/client.py", line 2642, in _handle_on_message
callback(self, self._userdata, message)
File "/opt/DEV2-insteon-mqtt/DEV2-insteon-mqtt-venv/lib64/python3.6/site-packages/insteon_mqtt/mqtt/Outlet.py", line 157, in handle_set
self.device.set(group, is_on, instant=instant)
File "/opt/DEV2-insteon-mqtt/DEV2-insteon-mqtt-venv/lib64/python3.6/site-packages/insteon_mqtt/device/Outlet.py", line 233, in set
self.on(group, level, instant, on_done)
File "/opt/DEV2-insteon-mqtt/DEV2-insteon-mqtt-venv/lib64/python3.6/site-packages/insteon_mqtt/device/Outlet.py", line 156, in on
assert 1 <= group <= 2
AssertionError

@djfjeff
Copy link
Author

djfjeff commented Apr 3, 2018

Also, when switching an off outlet to on, I get no error but the outlet stay off and still report off in HASS (nothing show up in MQTT) :

2018-04-03 09:09:45 DEBUG Outlet: Outlet btn 1 message insteon/34.a3.xx/set/1 b'ON'
2018-04-03 09:09:45 DEBUG MsgTemplate: Input template render: '{ "cmd" : "on" }'
2018-04-03 09:09:45 INFO Outlet: Switch input command: {'cmd': 'on'}
2018-04-03 09:09:45 INFO Outlet: Outlet True grp: 34.a3.xx cmd: on
2018-04-03 09:09:45 INFO Protocol: Write to modem: Std: 34.a3.xx, Type.DIRECT, 11 ff
2018-04-03 09:09:45 DEBUG Protocol: Write to modem: 02 62 34 a3 xx 0f 11 ff
2018-04-03 09:09:45 DEBUG Serial: Wrote 8 bytes to serial /dev/insteon
2018-04-03 09:09:45 INFO Protocol: Read 0x62: Std: 34.a3.xx, Type.DIRECT, 11 ff ack: True
2018-04-03 09:09:45 DEBUG Protocol: Passing msg to write handler
2018-04-03 09:09:45 DEBUG StandardCmd: 34.a3.xx got msg ACK
2018-04-03 09:09:45 INFO Protocol: Read 0x50: Std: 34.a3.xx->49.f7.73 Type.DIRECT_ACK cmd: 11 ff
2018-04-03 09:09:45 DEBUG MsgHistory: Received 0 hops, total 0 for 1 entries
2018-04-03 09:09:45 DEBUG Protocol: Passing msg to write handler
2018-04-03 09:09:45 DEBUG Outlet: Outlet 34.a3.02 grp: True ACK: Std: 34.a3.xx->49.f7.73 Type.DIRECT_ACK cmd: 11 ff
2018-04-03 09:09:45 INFO Outlet: Setting device 34.a3.xx (couch_left_outlet) grp: True on True
2018-04-03 09:09:45 INFO Outlet: MQTT received active change 34.a3.xx (couch_left_outlet) = True
2018-04-03 09:09:45 DEBUG Mqtt: MQTT publish insteon/34.a3.xx/state/True ON qos=2 ret=1
2018-04-03 09:09:45 DEBUG Protocol: Write handler finished
2018-04-03 09:09:45 DEBUG Mqtt: MQTT writing

@djfjeff
Copy link
Author

djfjeff commented Apr 3, 2018

One last quick update. The initial state (on or off) of the outlet show correctly in HASS on startup. It seems that only toggling them is broken.

Also, FYI, I ran the pair command to add group 2 to the list (however, I saw that it only add CTRL to the outlet and RESP to the modem).

@TD22057
Copy link
Owner

TD22057 commented Apr 3, 2018

Thanks - I think I've got some arguments reversed in one of the func calls. I'll take a look tonight and fix it.

@TD22057
Copy link
Owner

TD22057 commented Apr 4, 2018

Yup - I had the arguments in the mqtt->insteon command backwards. I also added the missing link in the pair command for the group 2 outlet.

@djfjeff
Copy link
Author

djfjeff commented Apr 4, 2018

Tested and works fine now for both the top and bottom outlet! I will close this issue as it seems it's resolved, thanks!

@djfjeff djfjeff closed this as completed Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants