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

Add new tele- rule triggers #7093

Merged
merged 1 commit into from
Dec 2, 2019
Merged

Conversation

ascillato
Copy link
Contributor

Description:

By adding the rule trigger tele-power1#state for relays (as done in PR #7088 for switches), this PR also unlocks several other triggers for rules, that were accessible before only by the scripting feature.

New set of rule triggers:

  • tele-power1#state
  • tele-wifi1#ap
  • tele-wifi1#ssid
  • tele-wifi1#bssid
  • tele-wifi1#channel
  • tele-wifi1#RSSI
  • tele-wifi1#LinkCount
  • tele-wifi1#Downtime

Related issue (if applicable): fixes some custom periodics updates for power status as done in PR #7088 for switches. If a Home Automation Software can't use the information of teleperiod and/or status 11 as Tasmota's default, now the user can use a rule, to be triggered at teleperiod time, so as to periodically inform relay's status or wifi status like for example:

rule1 1
rule1 on tele-relay1#state do publish stat/mydevice/relay1 %value% endon

This PR is backwards compatible due there was no trigger for relays or wifi at teleperiod time and it also don't affect the instantaneous trigger power1#state.

At this moment, the Tele message is like:

15:04:57 MQT: tele/living/STATE = {"Time":"2019-12-02T15:04:57","Uptime":"0T00:06:13","UptimeSec":373,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","Wifi":{"AP":2,"SSId":"NetWirelessB","BSSId":"D8:5D:4C:C6:84:56","Channel":11,"RSSI":52,"LinkCount":1,"Downtime":"0T00:00:06"}}

and with this PR, it changes to:

15:04:57 MQT: tele/living/STATE = {"Time":"2019-12-02T15:04:57","Uptime":"0T00:06:13","UptimeSec":373,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":{"STATE":"OFF"},"Wifi":{"AP":2,"SSId":"NetWirelessB","BSSId":"D8:5D:4C:C6:84:56","Channel":11,"RSSI":52,"LinkCount":1,"Downtime":"0T00:00:06"}}

Checklist:

  • The pull request is done against the latest dev branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR.
  • The code change is tested and works on core 2.6.1
  • The code change pass travis tests. Your PR cannot be merged unless tests pass
  • I accept the CLA.

@arendst arendst merged commit 45d5999 into arendst:development Dec 2, 2019
@ascillato ascillato deleted the patch-1 branch December 2, 2019 18:54
@jziolkowski
Copy link
Contributor

This changes STATE message to "POWER1":{"STATE":"ON"},"POWER2":{"STATE":"ON"} breaking HA autodiscovery, TDM and I guess quite a few other things observing STATE message

@ascillato
Copy link
Contributor Author

Reverting back this change in Tasmota's status message due to it is breaking backwards compatibility with several tools and setups.

See ##7127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants