FHEM Forum

FHEM => English Corner => Thema gestartet von: andyclimb am 15 Mai 2017, 22:47:00

Titel: on off not displaying correctly for readingsProxy
Beitrag von: andyclimb am 15 Mai 2017, 22:47:00
Another question for the FHEM gurus.

I've defined a readings proxy to take the reading from an MQTT_DEVICE and turn it into its own device, only the on, off only displays as a drop down box, not the two buttons it does for everything else. see photos..

The other screen shot shows the standard webcmd that I would like.

any ideas?
Titel: Antw:on off not displaying correctly for readingsProxy
Beitrag von: andyclimb am 22 Mai 2017, 17:14:23
any ideas anyone? I'd like readingsProxy to display  a lightbulb with on off commands instead of a dropdown box.  Everything I've tried does not work! 
Titel: Antw:on off not displaying correctly for readingsProxy
Beitrag von: LuckyDay am 22 Mai 2017, 17:33:43
webCmd     on:off
Titel: Antw:on off not displaying correctly for readingsProxy
Beitrag von: andyclimb am 23 Mai 2017, 00:00:28
Thanks for the reply... unfortunately that does not work.

I've defined a readings proxy for a reading on an MQTT device.  It has 3 switches and I want three separate switches in them for each one.


define proxy_testswitch_stereo readingsProxy mqtt_testswitch:stereo
attr proxy_testswitch_stereo group Multimedia
attr proxy_testswitch_stereo room mqqt


I can get this to work well, by defining a setList as follows

attr proxy_testswitch_stereo setList stereo:on,off


this gives me access to stereo on/off..   see image1

but there is no link. 

if i then specify a webCmd as on:off

I get this error message: Unknown argument on, choose one of stereo:on,off

If I set webcmd to stereo, then I get a dropdown box and not an on:off link.

so what am I missing? 

Titel: Antw:on off not displaying correctly for readingsProxy
Beitrag von: andyclimb am 23 Mai 2017, 07:57:17
OK got it to work:)  finally


defmod proxy_testswitch_stereo readingsProxy mqtt_testswitch:stereo
attr proxy_testswitch_stereo group Multimedia
attr proxy_testswitch_stereo room mqqt
attr proxy_testswitch_stereo setFn {($ CMD eq "on")? "stereo on": "stereo off";;}
attr proxy_testswitch_stereo setList on off
attr proxy_testswitch_stereo valueFn stereo
attr proxy_testswitch_stereo webCmd on:off