I have new boiler switch module flash with tasmota that work ok with regular on off command from OH
I want to set up 2 or more switch with count down timer using tasmota rules with timer rules and that also work fine
My problem is that I cant get back the count down timer value or the result for the rule command
what I missing?
this is my thing:
Thing mqtt:topic:boiler “Boiler” (mqtt:broker:MosquittoMqttBroker) {
Channels:
Type switch : power “Power Switch” [
commandTopic=“cmnd/boiler/POWER”,
stateTopic=“stat/boiler/POWER”,
on=“ON”,
off=“OFF”
]
Type string : Boiler_Rule1 [
commandTopic="cmnd/boiler/RULE1",
stateTopic="stat/boiler/RULE1"
]
Type string : Boiler_RuleTimer1_State [
commandTopic="cmnd/boiler/RULETIMER",
stateTopic="stat/boiler/RULETIMER"
]
rule “Test Boiler send rule”
when
Item Boiler_test changed
then
if(Boiler_test.state==ON)
{
strBoiler_Rule1.sendCommand(“ON Power1#state=1 DO RuleTimer1 10 ENDON ON Rules#Timer=1 do Power1 off ENDON”)
}
What specifically do you want? The time remaining on your countdown, or just the initial countdown time?
Do I understand correctly that you automatically want to switch off your boiler 10 seconds after it was switched on?
I’d be surprised if you could access the remaining time at all, and think you’d only be able to access the initial time if it was defined as a variable within Tasmota (but then, you’re using openHAB to send the initial time anyway…)
To get the result for the rule command, you need to subscribe to the stat/boiler/RESULT topic.
2020-12-19 10:24:22.431 [vent.ItemStateChangedEvent] - Boiler_test changed from OFF to ON
2020-12-19 10:24:22.806 [ome.event.ItemCommandEvent] - Item 'strBoiler_Rule1' received command ON Power1#state=1 DO RuleTimer1 10 ENDON ON Rules#Timer=1 do Power1 off ENDON
2020-12-19 10:24:22.815 [nt.ItemStatePredictedEvent] - strBoiler_Rule1 predicted to become {"T1":0,"T2":0,"T3":0,"T4":0,"T5":0,"T6":0,"T7":0,"T8":0}
This is what you want, isn’t it? Looks like T1 is your remaining time?
You just need to update one of your existing things, or make a new string or number thing, with stateTopic="stat/boiler/RESULT" and transformationPattern="JSONPATH:$.T1"
Did you send the ruletimer command yourself on the console? If so, you’ll have to constantly send that command to have an up to date time.
For the return result, what do you plan to do with it? Just sending Rule1 will return info on stat/boiler/RESULT
When I update one thing to the RESULT I receiving with that thing all the result and not only the timer result
Is there a way to send mqtt command like I can do in the console?
Yes, though this isn’t usually a problem - just WARN noise in the logs. However, you can filter the incoming message using REGEX. Install the REGEX Transformation Service, then try something like