landixus
(Andreas)
December 4, 2016, 7:51am
1
I have a switch/relay that worked great with MQTT:
Switch Sonoff2 "Sonoff 2" {mqtt=">[schuppen1:/Sonoff2/gpio/12:command:ON:1],>[schuppen1:/Sonoff2/gpio/12:command:OFF:0]"}
But i fail with my rule to switch to a specified time:
rule “XMASbeleuchtung Mama einschalten”
when
Time cron “0 0 20 * * ?”
then
sendCommand(Switch Sonoff2, ON)
end
rule “XMASbeleuchtung Mama ausschalten”
when
Time cron “0 0 22 * * ?”
then
sendCommand(Switch Sonoff2, OFF)
end
the rule have the ending *.rules
I have no further addons installed so far except MQTT stuff.
What i am doing wrong here?
I use openhab 1.8.3 on a Raspberry 3 with Jessie onboard
landixus
(Andreas)
December 4, 2016, 8:56am
3
martiniman:
Sonoff2.sendCommand(ON)
this way?
rule “XMASbeleuchtung Mama einschalten”
when
Time cron “0 0 20 * * ?”
then
Sonoff2.sendCommand(ON)
end
rule “XMASbeleuchtung Mama ausschalten”
when
Time cron “0 0 22 * * ?”
then
Sonoff2.sendCommand(OFF)
end
landixus
(Andreas)
December 4, 2016, 9:08am
5
is not working, also no log entry in openhab.log or mqtt.log
do i need any addons for this?
martiniman
(martiniman)
December 4, 2016, 9:22am
6
You use Cron rule “0 0 22 * * ?” - it fires at 22:00.
Try to change to “0 * * * * ?” - every minute to check it works.
landixus
(Andreas)
December 4, 2016, 9:27am
7
yepp i tried this, but unfortunately the switch is not switching.
martiniman
(martiniman)
December 4, 2016, 9:44am
8
I use:
Switch Light_Table_CMD "Lamp" <light> (gLights) { mqtt=">[agdisk:/esp/lamp/gpio/output14:command:*:MAP(on_is_1.map)], <[agdisk:/esp/lamp/gpio/output14:state:MAP(1_is_on.map)]" }
map files in transform
folder:
on_is_1.map
OFF=0
ON=1
1_is_on.map
0=OFF
1=ON
-=?
undefined=?
landixus
(Andreas)
December 4, 2016, 9:45am
9
Thank you for your help i try this out later, i need a break
landixus
(Andreas)
December 4, 2016, 5:24pm
10
I have adept your settings but the rule is still not working, also not with 1 minute cron.
Do i need a addon for this?
landixus
(Andreas)
December 4, 2016, 6:56pm
11
Ah it works now, during the configure i delete a -> " thanks very much for help!