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

Sonoff POW telemetry update #1032

Closed
mkh595 opened this issue Oct 17, 2017 · 9 comments
Closed

Sonoff POW telemetry update #1032

mkh595 opened this issue Oct 17, 2017 · 9 comments
Labels
stale Action - Issue left behind - Used by the BOT to call for attention

Comments

@mkh595
Copy link

mkh595 commented Oct 17, 2017

When relay change state On/Off, on web interface are measured values Voltage, Power, Current,... updated immediately. But MQTT message is send only when telemetry period is reached. This leads to discrepancy in HA, where switch is updated immediatly e.g. to ON but Voltage, Power, Current shows still 0.

Can be sent after change of relay state also telemetry data to have correct values and not wait till telemetry period is reach?

tele/home214/ENERGY = {"Time":"2017-10-17T16:21:02", "Total":74.901, "Yesterday":0.587, "Today":1.297, "Period":1, "Power":79, "Factor":0.91, "Voltage":224, "Current":0.384}

@davidelang
Copy link
Collaborator

davidelang commented Oct 17, 2017 via email

@calcipher49
Copy link

if you do not want to wait telemetry period, you can query Energy infos using cmd:
STATUS 8

@stefanbode
Copy link
Contributor

I do understand the problem and normally would also vote for a telemetrie update, if the power gets changed that is read for example on a per second intervall. But, after doing some investigation there are some not easy to overcome problems. 1. do you really want to flood your MQTT server every second, if there s a change. 2. what is a ‚change‘? More than 1% or 5% from actual value.

All not very easy to Programm on a general way. My workaround is to use ‚teleperiod 15‘. This works OOTB and the delay is maximum 14 seconds.

@davidelang
Copy link
Collaborator

davidelang commented Oct 28, 2017 via email

@stefanbode
Copy link
Contributor

What about the value you see in the web interface. These look to me like calculated on a per second base.

@mkh595
Copy link
Author

mkh595 commented Nov 25, 2017

if you do not want to wait telemetry period, you can query Energy infos using cmd:
STATUS 8

@calcipher49 : This is not solution. HA can have only one topics subscribtion per field. But command STATUS8 returns different topic and different structure of JSON, energy is in sub level. I don't understand why same values are returned back in two different topics.
The other complication is to tell to HA when to issue STATUS8 message.

14:45:59 MQT: tele/home212/ENERGY = {"Time":"2017-11-25T14:45:58", "Total":542.524, "Yesterday":4.565, "Today":2.454, "Period":0, "Power":0, "Factor":0.00, "Voltage":0, "Current":0.000}
14:45:59 CMD: cmnd/Status 8
14:45:59 MQT: stat/home212/STATUS8 = {"StatusPWR":{"Total":542.524, "Yesterday":4.565, "Today":2.454, "Power":0, "Factor":0.00, "Voltage":0, "Current":0.000}}

@mkh595
Copy link
Author

mkh595 commented Nov 25, 2017

@stefanbode : Why should be MQTT message sent each second? When relay change state, then counter can be set to teleperiod value. E.g.
tele_period = Settings.tele_period -1
and next second will be MQTT message sent. Maybe solution is to add this one line

If relay is set OFF, power and current became 0 immediately, there is no measure necessary.
If relay is set ON, after two seconds is new value there, tested in web interface.

But this is still better than wait several seconds for correct values till teleperiod 15, 30, 60, ... seconds is reached.

@stale
Copy link

stale bot commented Apr 23, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Action - Issue left behind - Used by the BOT to call for attention label Apr 23, 2018
@stale
Copy link

stale bot commented May 7, 2018

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Action - Issue left behind - Used by the BOT to call for attention
Projects
None yet
Development

No branches or pull requests

4 participants