claudegel / sinope-130

Neviweb130 custom component for Home Assistant to manage devices connected via a GT130 and wifi devices from Sinopé
GNU General Public License v3.0
63 stars 13 forks source link

Correcting Errors/Warning found during integration #155

Closed ericgu08 closed 1 year ago

ericgu08 commented 1 year ago

I have a SW2500ZB zigbee switch and a TH1124ZB thermostat with old firmware. I just purchased the GT130 gateway and am in the process of integrating your component. I investigated some errors and made minor corrections to some files:

Error/Warning Corrected:

Question: Do you have an idea how long it takes before the Firmware gets updated? Currently over 24h and no change.

claudegel commented 1 year ago

Thanks for sending this PR. Everything looks good except one thing in services.yaml The set_control_onOff, if we change it to set_control_onoff we will have to reflect this name change in const.py and switch.py. If somebody is using that service in automation it will break because it is using the old name. So I prefer to leave it as set_control_onOff. Many of your fix was hard to catch, a dot instead of a coma.

claudegel commented 1 year ago

About the firmware update it normally take one or two days. It could be a little longer if Sinopé is updating Neviweb for new device like the LM4110-ZB, tank level monitor, that is coming in May.

ericgu08 commented 1 year ago

Merci Claude! I'm glad to be able to make a small contribution.

You have a good point about the breaking change and I trust your judgment. Maybe it's just my setup, but besides the unable to parse... error, there may be other effects that deserve your attention. My setup includes all the latest updates, by the way.

If I go to Developer Tools, then SERVICES, enter Sinope Neviweb130: set_light_keypad_lock in service, then GO TO UI MODE, I can see the All available parameters information and the information from your services.yaml. I can do FILL EXAMPLE DATA and I get:

service: neviweb130.set_light_keypad_lock
data:
  entity_id: light.neviweb130_light_office
  lockKeypad: locked

I can replace with one of my light switches, do CALL SERVICE and the keypad becomes locked.

If I reintroduce set_control_onOff, and I follow the same procedure, I do not get the All available parameters. It appears that all the information from the services.yaml file becomes unavailable. Do you get the same behavior?

Also, it seems that at one time, set_control_onOff was not listed, but now I can see set_control_onoff (without capitalization) all the time. It seems to be cached somewhere, because even if I remove this service completely from services.yaml, it still appears in the list. Anyway, all this to say that maybe it is still worth introducing a breaking change. It's up to you and I won't be offended if you leave it like that.

Thanks for your work!

By the way, my switches are getting updated (ver 1.3.2), but not my thermostat (stuck at 0.5.5) for more than 5 days now. The GT130 is at version 2.5.0, which may already be up to date, since it is brand new.

I don't like this approach, I should get notified, or be able to verify manually if there is a new firmware available, then decide if and when I want to update it.

claudegel commented 1 year ago

After more testing it appear that HA translate onOff to onoff in the services name and it cause a problem that affect the reading of the file services.yaml. So we have no choice that to remove the onOff and change all the files affected. Thank's for pointing this out. I'm gonna make all changes in branch onoff-bug then make a new release. I'll let you know when it is ready to test before the release. About the firmware update I've talked to Sinopé and they should release the firmware so we will be able to update devices in ZHA. But there is no time frame for that.

claudegel commented 1 year ago

If you want to test branch onoff-bug it's ready. On my side it is working Let me know so I can merge it and make a new release

ericgu08 commented 1 year ago

Hello Claude,

I give it a quick shot and it works perfectly for me. The error "unable to parse" is not there, and the services tab in the developper tools works normally. I was also able to lock/unlock one of my light switch keypad by calling the service. Thank for fixing this!