-
Notifications
You must be signed in to change notification settings - Fork 41
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
Shutter position wrong in Home Assistant #57
Comments
Hi Christian, yes this makes perfect sense. I also checked that this will save me some bytes if I just do it a little different. I just uploaded a new version with the change. The result is reported twice Just too complicated to fix, therefore I leave it as it is because it should not make a problem. Here how the shutterstop will behave:
|
There is also on option already to use the SENSOR data that came in with TELEPERIOD to update the position:
|
Hi @stefanbode sorry for the delay in the tests. I updated the firmware a few minutes ago. It is working perfect for the "field" position in Home Assistant. |
@stefanbode, I forgot the test using the switch manually & web frontend. The result of my test, It was like what @udo1toni mentioned. |
I have the same issue as @ctripodi , I have the latest firmware flashed but the position is not reported correctly. Using a Sonoff Dual R2 here. |
For the button or switches this is more complicated. Can you check if it works if you set teleperiod to 10 and unse the reported shutter position from this point. |
I Introduced a new RESULT sending all the time, if the shutter STOP moving. This will report the actual position. To be in sync with the TELEPERIOD the format is different form the "shutterpositionyy xx" stuff. As you can see in the log I set the shutterposition to 80. This will be reported directly as RESULT = {"shutterposition1":80}. But the real position of the shutter is reported later on at: You will get this message also, if you change movement during operation and/or moving the shutter by hand. Hopefully this helps with your requirements.
|
Thanks @stefanbode , with your last update It seems like is working as expected, great job! For more details this is my actual cover config in HA:
|
Hi, these are great news. Looks like I get now more or less a stable version that is worth to request a merge request with the master branch. Thanks for your support |
Hi @stefanbode, Any suggestion to how solve this issue? |
Hi @stefanbode . Can you maybe add retain flag to tele/%topic%/RESULT so after HA restart it will get current position of cover? |
Ok, it gets more and more complex. Anyhow. It is not a good advise to use RESULT and retain this one. As it is done with POWER1 and POWER2 the value is retained in a special tag. Therefore it is possible to retain, but then I would introduce a new tag like the power to do this and also use the power retain flag to control if it is retained or not. |
Got you. So as for me don't bother about this. Do you have same behaviour for shutterclose/shutteropen in web console? Maybe I #undef too much things to get image lighter. Correct reason is Software watchdog.
|
@pszafer I think this is more a HA related issue. Im not at home right now so I cant test it, but you could try calling shutterstop on the home assistant start event. This way you force a new tele message from Sonoff whenever HA starts. |
I'm doing it, like this. Just suggested that maybe it could be avoided.
|
Hi @pszafer, |
@B1G1 , I'm litte confused now.
or
or
|
You have to use |
@stefanbode Is there any possibility you could enable the minimal version of your firmware so I can upload it via OTA? When now I try to upload the sonoff full version I receive the buffer error. |
@pablitofernandez undef unnecessary modules. |
@pszafer How can I do that? And how do I know which modules are unnecesary? thanks!! |
Use user_config_override.h from my previous post. If you don't use IR I guess you don't need IR remote etc. :) |
Thanks @pszafer !!! It worked as you said. But now I have a problem, I have this settings in Home Assistant:
I can see the shutterposition updating but when I restart HA is not retained. @B1G1 can you help? |
Did you set powerretain 1 in console? |
Ok my bad! I set powerretain 1 in console and now its working perfectly. Thank you all for this excellent job!!!!! |
In my HA config, instead, i set retain: false because sometimes mqtt broker was retaining messages and restarting HA it sent uwanted commands |
Hopefully, soon we will be able to set position from HA even if cover is fully open or close. |
Hi @stefanbode , first of all, thank you for this great project "upgrade"!
I am using Home Assistant with this configuration (I the example available in Wiki didn't work for me):
This is my cover definition:
name: "Test"
availability_topic: "hm/tele/sonoff_cover/LWT"
state_topic: "hm/stat/sonoff_cover/RESULT"
command_topic: "hm/cmnd/sonoff_cover/backlog"
value_template: '{{value_json.shutterposition1}}'
qos: 1
retain: true
payload_open: "SHUTTEROPEN"
payload_close: "SHUTTERCLOSE"
payload_stop: "SHUTTERSTOP"
state_open: "ON"
state_closed: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
optimistic: true
tilt_command_topic: 'hm/cmnd/sonoff_cover/shutterposition'
tilt_status_topic: 'hm/cmnd/sonoff_cover/shutterposition'
set_position_topic: 'hm/cmnd/sonoff_cover/shutterposition'
tilt_min: 0
tilt_max: 100
tilt_closed_value: 0
tilt_opened_value: 100
The problem is that the current_tilt_position & current_position is not updated after use the buttoms to open or close in the web interface of Home Assistant (yellow mark), so you have 2 status forthe same Entity (red marks).
I guess that this could be solved, with the inclution of a json status update after finish the command (SHUTTEROPEN, SHUTTERCLOSE or SHUTTERSTOP) some like this (according to the real status of shutterposition1):
I am using this switches:
Thanks. Cristian
The text was updated successfully, but these errors were encountered: