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

Request: Retain flag on SENSOR data #74

Closed
tam481 opened this issue Feb 16, 2017 · 9 comments
Closed

Request: Retain flag on SENSOR data #74

tam481 opened this issue Feb 16, 2017 · 9 comments
Labels
enhancement Type - Enhancement that will be worked on

Comments

@tam481
Copy link

tam481 commented Feb 16, 2017

Hi Theo,
Would it be possible to retain sensor messages?

thanks in advance

@davidelang
Copy link
Collaborator

what do you mean by retain sensor messages?

If you are meaning to save the temp/humidity/power data to flash so that it's not lost on a reboot, that's not really possible because flash is write limited, it will wear out, so writing to it every time we get a new piece of data would cause the devices to wear out much faster.

It's far better to have your home automation system grab the data and store it in some method. Even if you use a Pi and write to a SD card, you can at least replace the SD card when it wears out and not have to replace the entire computer (or in the case of the sonoffs, all the computers wired into things around your house as they wear out) :-)

@khcnz
Copy link

khcnz commented Mar 19, 2017

Was this in relation to setting the retain flag on the MQTT messages (same as the below concept?)
#define MQTT_BUTTON_RETAIN
#define MQTT_POWER_RETAIN
#define MQTT_SWITCH_RETAIN

@davidelang
Copy link
Collaborator

davidelang commented Mar 19, 2017 via email

@khcnz
Copy link

khcnz commented Mar 19, 2017

I haven't looked at the code but one of us is confused - i was talking about the retain flag sent on the MQTT messages which tells the broker to store this message. Nothing to do with flash

@davidelang
Copy link
Collaborator

davidelang commented Mar 19, 2017 via email

@khcnz
Copy link

khcnz commented Mar 20, 2017

I have had a look at source - pretty sure I am correct and these relate to the retain flag on the MQTT message.

The point of the retain flag is that the message is cached by the broker so when you connect you will receive the most recent value that has been posted. This ensures that as long as your server is always reachable by sonoff then any client that would like to receive the most recent value can just ask the MQTT broker - thats an expected pattern good write up here about how it may be useful in an IOT world http://www.steves-internet-guide.com/mqtt-retained-messages-example/

I'd suggest its a valid use case and re-open the ticket for prioritization. the change would be pretty trivial.

@davidelang
Copy link
Collaborator

davidelang commented Mar 20, 2017 via email

@khcnz
Copy link

khcnz commented Mar 20, 2017

It wasn't my ticket and i don't have issue permission :)

@davidelang davidelang reopened this Mar 20, 2017
@davidelang davidelang added the enhancement Type - Enhancement that will be worked on label Mar 20, 2017
@arendst
Copy link
Owner

arendst commented May 4, 2017

Implemented SensorRetain on message tele/sonoff/SENSOR in next release.

arendst added a commit that referenced this issue May 4, 2017
5.0.3 20170504
* Add command SensorRetain on|off to enable retaining of mqtt message
tele/sonoff/SENSOR (#74)
* Change WifiConfig timeout from 60 seconds to 180 seconds (#212)
* Change Sonoff Touch command Ledstate functionality by turning led on
if power is off (#214)
* Add 4 seconds delay after power on before enabling button to
workaround Wemos D1 mini RTS circuit (#380)
@arendst arendst closed this as completed May 14, 2017
ascillato added a commit that referenced this issue Jun 5, 2018
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
5.0.3 20170504
* Add command SensorRetain on|off to enable retaining of mqtt message
tele/sonoff/SENSOR (arendst#74)
* Change WifiConfig timeout from 60 seconds to 180 seconds (arendst#212)
* Change Sonoff Touch command Ledstate functionality by turning led on
if power is off (arendst#214)
* Add 4 seconds delay after power on before enabling button to
workaround Wemos D1 mini RTS circuit (arendst#380)
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 7, 2018
vicfergar pushed a commit to vicfergar/Sonoff-Tasmota that referenced this issue Mar 30, 2019
Shuttercalibration will change over time and enhance. Issue arendst#75  and arendst#74
fixed
vicfergar pushed a commit to vicfergar/Sonoff-Tasmota that referenced this issue Mar 30, 2019
Step 1 of enhanced calibration. open and close duration for shutter are
now 0.1 second precise.
vicfergar pushed a commit to vicfergar/Sonoff-Tasmota that referenced this issue Mar 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type - Enhancement that will be worked on
Projects
None yet
Development

No branches or pull requests

4 participants