FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: NDR008 am 30 Mai 2017, 20:20:19

Titel: get state fragen
Beitrag von: NDR008 am 30 Mai 2017, 20:20:19
Hallo,

Wann ich FHEM via brower offenen, meine IKEA licht internal state is falsch.
zB. Wann der licht war an, und dan FHEM geoffnet, es sagt "off".
Wann ich schreibe get <ikea_light> state, "on" konmt zuruck.

Auch mit FTUI, wann ich habe
<div class="inline" data-type="dimmer" data-device="TV" data-get="state" data-get-value="dimvalue" data-set-on="on" data-set-off="off" data-dim = "dimvalue" data-max="254" data-step="2" ></div>

Aber es funzionirt nicht fur der ertste mal. dimvalue, ist gut, nur die "state" ist falsch und auch nur fur die ertste mal.

Was kann ich mache?
Titel: Antw:get state fragen
Beitrag von: igami am 30 Mai 2017, 21:31:07
Zitat von: NDR008 am 30 Mai 2017, 20:20:19
Wann ich FHEM via brower offenen, meine IKEA licht internal state is falsch.
zB. Wann der licht war an, und dan FHEM geoffnet, es sagt "off".
Wann ich schreibe get <ikea_light> state, "on" konmt zuruck.
Also wenn du das Licht von Hand schaltest bekommt FHEM das nicht mit?
Titel: Antw:get state fragen
Beitrag von: NDR008 am 30 Mai 2017, 22:01:13
Tut mir leid, ich frage auf Englisch.

If I switch on the light (real_state="on") before opening FHEM, FHEM shows state="off". (niO)
If I change light state by hand via remote control, real_state="off" and again real_state="on", FHEM shows state="off". (niO)
If I type "get <device> state", result = "on". (iO)
If I change light state by hand via remote control, real_state="off" and again real_state="on", FHEM shows state="off". (niO)

But if I set attr <device> AutoUpdateInterval = 1 (1second), then it is good...

My FTUI:
<div class="inline" data-type="dimmer" data-device="Study" data-cmd="state" data-get="state" data-get-value="dimvalue" data-set-on="on" data-set-off="off" data-dim = "dimvalue" data-max="254" data-step="2" ></div>
<div class="inline" data-type="select" data-device="Study" data-items='["warm","cold","standard"]' data-set="color" ></div>
   
Titel: Antw:get state fragen
Beitrag von: igami am 30 Mai 2017, 22:07:08
English is okay.

I don't use the IKEA module. But it sounds that FHEM dosn't recognize the switch by remote control. So each time after a switch you need to request the actual state. I think there are two options:
1. use the AutoUpdateInterval attribute to poll the status every X seconds
2. maybe it's possible to send a "get" when the FTUI page becomes loaded
Titel: Antw:get state fragen
Beitrag von: NDR008 am 30 Mai 2017, 22:30:36
fhem is not recognising state even if i refresh browser of dashboard view when loading the page at least?

thanks.

do you know how to force get state?
Titel: Antw:get state fragen
Beitrag von: igami am 30 Mai 2017, 22:50:30
Zitat von: NDR008 am 30 Mai 2017, 22:30:36
fhem is not recognising state even if i refresh browser of dashboard view when loading the page at least?
you need to request the current state by the "get" command. this is module specific and not a fhem thing.
Zitat von: NDR008 am 30 Mai 2017, 22:30:36
do you know how to force get state?
For the FHEMWEB you could use the second form of devStateIcon (http://commandref.fhem.de/#devStateIcon).
It should be something like

attr <name> devStateIcon {fhem("get $name state")}

But I don't know the side effects.

For FTUI I don't know because I don't use FTUI.
Maybe it will help if you move the Thread to the FTUI Board and change the title to "perform fhem command when loading page" or something else

Or just use the AutoUpdateInterval and wait for the implemention of "Update on/ off state in realtime"