nugget / python-insteonplm

Python 3 asyncio module for interfacing with Insteon Powerline modems
MIT License
33 stars 19 forks source link

Add support for 2441V thermostat adapter #95

Closed wz2b closed 1 year ago

wz2b commented 6 years ago

Trying to test 2441V but I don't think I have the homeassistant configuration.yaml correct can someone point me to the config?

wz2b commented 6 years ago

I am trying to test the 2441V support but the device is not being detected. Actually, it sort of is, but what is this?

2018-09-02 11:44:37 DEBUG (MainThread) [insteonplm.plm] Processing message {'code': 0x57, 'controlFlags': 0xe2, 'group': 0x00, 'address': 11.B3.17, ' linkdata1': 0x01, 'linkdata2': 0x00, 'linkdata3': 0x00} 2018-09-02 11:44:37 DEBUG (MainThread) [insteonplm.plm] Last item in self._recv_queue reached. 2018-09-02 11:44:37 DEBUG (MainThread) [insteonplm.plm] Finishing: _peel_messages_from_buffer 2018-09-02 11:44:37 DEBUG (MainThread) [insteonplm.plm] Found all link record for device 11b317 2018-09-02 11:44:37 DEBUG (MainThread) [insteonplm.plm] ALDB Data: address 11b317 data1: 01 data1: 00 data3: 00 2018-09-02 11:44:38 DEBUG (MainThread) [insteonplm.states] Registering callbacks for DimmableSwitch device 11.B3.17

That's the thermostat adapter (11.B3.17) but why does it think it's a DimmableSwitch?

I might just not have homeassistant configured correctly. I just have climate: by itself

teharris1 commented 6 years ago

The process for device identification tries to use the modem's all-link record to see if it contains the device info. Often data1, data2, and data3 contain the cat, subcat and firmware version. However if the device found does not consistantly follow this pattern it creates a generic device and sends a device info request to get the actual device cat and subcat. In this case it will reject DimmableSwitch (cat: 0x01, subcat 0x00) from the all-link record and trie to query the device for it's information. You will probably see that somewhere down in the log.

I am currently working on the 2441th but it is only partially done. I need a few more weeks to complete it. I believe the 2441th and the 2441v are basically the same.

wz2b commented 6 years ago

They definitely are almost the same. The 2441V (at least attached to the insteon thermostat that I have) doesn't have humidity. The other difference (maybe) I noticed is that there's a status message cmd1=0x70 for reporting the status. WIthout that, you just get ON and OFF messages. A note in the developers guide says:

To set a device to get status reporting add a controller of device link with group 0xEF and set 0x2E to 0x08.

so I haven't been able to see that happen.

I had already forked and modified climateControl.py to duplicate class ClimateControl_2441th and make one specificaly for ClimateControl_2441v. I mostly did that because i anticipate other differences that I haven't discovered yet. But if you're working on this, I'll stop what I'm doing for now. If you need help testing I can help or contribute - just ask.

I suspect that after this there will be further work to do, because homeassistant/components/climate/ has no insteon_plm support (that I can see). I don't know enough about homeassistant to know how to do that but if nobody else is doing it I will make an attempt.

I'm also wondering in ipdb.py:

Product(0x05, 0x03, None, 'Thermostat Adapter', '2441V', ClimateControl_2441v),

Note I changed the product ID to "none" ... I'm not sure what that's supposed to be, but it was 0x1F before and it didn't recognize my device, so I changed it to "None." What should that really be?

--Chris

teharris1 commented 6 years ago

Yes, None is an appropriate value. I am not sure why it was set to that. Please (please, please, please) go ahead and create the 2441v device. I would love to see how someone else can work with my code and create one of the more complex devices. As for the HA side, here is a link to my personal repo where climate has been created.: https://github.com/teharris1/home-assistant/tree/thermostat The files you need are: homeassistant/insteon/__init__.py homeassistant/climate/insteon.py

wz2b commented 6 years ago

Do you need to declare climate: in the configuration file or not at all - just the ALDB is all you need for it to find it and create a climate.* device?

teharris1 commented 6 years ago

I assume you mean in the HA config. If so, then no. You only need the device in the IPDB associated to a python object type and you need the two HA files referenced above.

teharris1 commented 6 years ago

If you create your own device in insteonplm then you need to add that device to the components/insteon/__init__.py file. Here is a link to the section to add it to: Import it here: https://github.com/teharris1/home-assistant/blob/thermostat/homeassistant/components/insteon/__init__.py#L369 And link it to the climate platform here: https://github.com/teharris1/home-assistant/blob/thermostat/homeassistant/components/insteon/__init__.py#L398

wz2b commented 6 years ago

I will try to work it out. I am running hassbian and I thought I had been keeping it up to date but it's still using insteon_plm not insteon ...

On Sun, Sep 2, 2018 at 7:55 PM Tom Harris notifications@github.com wrote:

If you create your own device in insteonplm then you need to add that device to the components/insteon/init.py file. Here is a link to the section to add it to: Import it here:

https://github.com/teharris1/home-assistant/blob/thermostat/homeassistant/components/insteon/__init__.py#L369 And link it to the climate platform here:

https://github.com/teharris1/home-assistant/blob/thermostat/homeassistant/components/insteon/__init__.py#L398

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/nugget/python-insteonplm/issues/95#issuecomment-417968851, or mute the thread https://github.com/notifications/unsubscribe-auth/ABc2Ob2QJppbBpz72-KpJsIw6eMjmHwLks5uXG_3gaJpZM4WWbr7 .

wz2b commented 6 years ago

My 2441V model doesn't have humidity, but the 2441TH one does. I tried removing the humidity property but that caused it to fail to load because the HA InsteonThermostatDevice model doesn't have it. What is the right way to handle this? Just leave it in place, but it never gets an update? There are some flags that are supposed to deal with this, SUPPORTED_FEATURE* but near as I can tell they only deal with the ability to set values, not retrieve them.

wz2b commented 6 years ago

For reference: my specific thermostat reports itself as Product ID 0x05:0x03:0x95. For some reason the 0x6E status message is reporting in degrees rather than half-degrees. Not sure if that's just because it's old or what. I can't find any documentation to support it reporting in degrees but cmd2 is definitely 0x49 which is decimal 73 (that's correct). Not sure what's going on here yet.

It's strange to me to have a conversation in ticket comments but OK. When I'm working on this I"m also on the HA discord #dev

wz2b commented 6 years ago

Is it possible that the existing thermostat code doesn't work (or at least the 0x2E status message)? The current implementation says it's for a 2441TH but it doesn't match the cmd1=0x2E message format described in the 2441TH developer's guide, so I'm wondering where this came from. It looks like it entered this codebase 18 days ago. I'm trying to decide whether I should fix it to match the developer notes; or leave it alone because somebody else knows it to work.

craigjmidwinter commented 5 years ago

@teharris1, anything I can help out with on this?

craigjmidwinter commented 5 years ago

I've got a 2441TH, I might try hacking around on the HASS side for the climate this weekend and see what I can get working from your branch @teharris1

teharris1 commented 5 years ago

@craigjmidwinter Have a look at this branch: https://github.com/teharris1/home-assistant/tree/thermostat It works (roughly) with the current version of insteonplm and HA. But not great.

craigjmidwinter commented 5 years ago

@teharris1 I poked around with that branch in my local install over the weekend, and it seems like it's pretty close! My thermostat is set to Celsius, and in order to be able to set the heatpoint and cool point, I needed to change the hardcoded units in the component, but after doing that, I had success setting the state at least. Getting the state from the component is another story though, the main temperature seems to always be in Farenheit, and the values that I get back for the heat point doesn't correlate to anything, from what I can tell. Didn't get to play with it too much as I've got a 3 week old that is commanding the bulk of my attention, but I might try to dig a bit deeper this weekend again if I have any spare time.

EDIT: Actually, it looks like the set point that comes in is 1/2 the actual value

Since this discussion is trending to be more about the HASS component dev, perhaps this issue isn't the best place to discuss it, should we create a new issue on your HASS fork?

teharris1 commented 1 year ago

Closing this issue as the insteonplm module is no longer maintained. Please use the pyinsteon module instead.