issues with on-for-timer on dummy

Begonnen von kroonen, 03 Mai 2016, 18:50:43

Vorheriges Thema - Nächstes Thema

kroonen

hi,

I'm trying to make my shutters work with an esp8266 and 2 relays

Everything works but not the timer, to set the shut it half size.

I tried on-for-timer and follow-on-for-timer but it doesn't shut the relay off

I have this in my config. Anybody idea what goes wrong?

define rolltest dummy
attr rolltest webCmd off:up:down
attr rolltest setList on off on-for-timer off-for-timer
attr rolltest eventMap /follow-on-for-timer 10:up/on-for-timer 10:down/off:closed
attr rolltest room Zolder

define rollswitchon notify rolltest:up { GetHttpFile('192.168.180.47:80', '/control?cmd=event,rol1');; }
attr rollswitchon room Zolder

define rollswitchon1 notify rolltest:down { GetHttpFile('192.168.180.47:80', '/control?cmd=event,rol2');; }
attr rollswitchon1 room Zolder

define rollswitchoff notify rolltest:off { GetHttpFile('192.168.180.47:80', '/control?cmd=GPIO,12,1');; }
attr rollswitchoff room Zolder


justme1968

dummys do not understand on-for-timer and related functions.

use a readingsProxy instead. or a dummy fs20 device.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

rudolfkoenig

I just added the useSetExtensions attribute to the dummy module, it is available by update tomorow after 8:00
ZitatIf set, and setList contains on and off, then the set extensions are supported.
     In this case no arbitrary set commands are accepted, only the setList and
     the set exensions commands.

Note: setExtensions automatically adds all the _missing_ commands, so you have to delete on-for-timer and off-for-timer from your setList.

kroonen

Hi

thesetextensions work but I still have  an issue, thatI want the right state value for my shutters

I only get off and open. So how can i Display the state, as the event map below, so on-for-timer 10. Now I get the on state and after 10 second the off state.With the fs20rsu I get this correct



define rolltest dummy
attr rolltest webCmd off:open:closed:vent
attr rolltest useSetExtensions
attr rolltest setList on off open closed
attr rolltest eventMap /on-for-timer 10:closed/on-for-timer 3:vent/off:stop
attr rolltest room Zolder

define rollswitchon notify rolltest:on { GetHttpFile('192.168.180.47:80', '/control?cmd=event,rol1');; }
attr rollswitchon room Zolder

define rollswitchon1 notify rolltest:open { GetHttpFile('192.168.180.47:80', '/control?cmd=event,rol2');; }
attr rollswitchon1 room Zolder

define rollswitchoff notify rolltest:off { GetHttpFile('192.168.180.47:80', '/control?cmd=GPIO,12,1');; }
attr rollswitchoff room Zolder

With an fs20rsu

define RolluikZolder FS20 cf4b 00
attr RolluikZolder IODev CUL
attr RolluikZolder devStateIcon open:fts_shutter_10 down:fts_shutter_100 closed-for-timer .*:fts_shutter_80
attr RolluikZolder eventMap /on:open/off:down/off-for-timer 10:vent/
attr RolluikZolder icon fts_shutter_automatic
attr RolluikZolder model fs20rsu
attr RolluikZolder room Zolder
attr RolluikZolder webCmd open:down:vent




rudolfkoenig

The FS20 has a built-in timer, this is why no off is displayed there. In fact, a lot of user wish to see the off state for FS20 devices instead on-for-timer, they have to set the follow-on-for-timer attribute.

The dummy has no "built-in" on-for-timer, SetExtensions generates on, and after a while off, this is what you see in the dummy state. But I see your problem: you'd like to differentiate between closed and vent. I suggest to forget useSetExtensions / on-for-timer, and use sleep in the notify instead:

define rollswitchclosed notify rolltest:closed { GetHttpFile('192.168.180.47:80', '/control?cmd=event,rol1') };; sleep 10;; { GetHttpFile('192.168.180.47:80', '/control?cmd=GPIO,12,1') }

Take care to use the FHEM-sleep, as the perl sleep blocks FHEM.
The FHEM sleep creates an InternalTimer with the rest of the commandline.