Creating a new device / grouping

Begonnen von andyclimb, 05 Juni 2015, 16:07:42

Vorheriges Thema - Nächstes Thema

andyclimb

if i can't have numbers then i need to use spaces in the list, which i also can't seem to do.. i've tried lots of ways.  Can I escape spaces in setList?
AM

justme1968

the problem with spaces is that a command containing spaces will always interpreted as a command followed by one or more parameters.

so you have to take the parameters into account.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

andyclimb

so is there no way of escaping spaces in fhem?  if so do you have an example?
AM

justme1968

you don't have to escape them.

if you use readingsProxy just evaluate $ARGS in addition to $CMD so die example random, random function and random color are the same command wird an additional optional parameter.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

andyclimb

So I've re-written my ESP8266 code to get rid of spaces, and use MQTT topics instead.  I am almost there. 

One simple problem remains.

I'm using an MQTT_DEVICE that listens to and pushes out MQTT messages to my "DEVICE"  I have several publishSet_timer attr set.  So for example i want to publish to "devicename/mode" and set it to on or off.  this works fine.. I can issue the command "set mqtt_test2 mode off" and my lights go off. 

The problem now comes when i want a ReadingsProxy to control it all.   I need on for mode on/off, one for mode effect, one for brightness, one for timer etc.  I'd also like a hyperlink there to take me to the main page..

What I want is a switch on the proxy reading, a bulb that when i click it will toggle the light on/off.... BUT... I can ONLY get a drop down box to actually work..
attr XYZ setList mode:on,off
attr webCmd mode


This works, but it does not give me a switch.  I have tried many permutations, and all have failed! 
AM

justme1968

to habe commands executed for a click in the icon you have to use the devStateIcon attribute.

see for example here: http://forum.fhem.de/index.php/topic,12080.msg71651.html#msg71651
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

andyclimb

mmm.. not quite

on:on:mode off:off:mode

does work.  but if i click the icon i get a pop up that appears, like the one for room choice, and that has a drop down box.. 

I just want a lightbulb..  the issue is that is must be attached to mode:  if i do not have mode:on,off in set list then nothing ever happens?
AM

justme1968

und mode is a commands that takes a parameter then a popup will apear.

if you just want on an and off then you should have a setList with on and off.

probably you can also use eventMap but only on and off should be much simpler.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

andyclimb

This is what I have been trying.  for several days now.  unless I have mode:on,off in the event map the command is NOT passed to the MQTT_DEVICE, as it is mapped to the reading mode. 

This mode, has to be identical to the reading that is is mapped to.. for example a readings proxy mapped to reading XYZ on MQTT_DEVICE ABC, must have  a setlist XYZ:a,b,c,d for it to be passed.  i've tried multiple variations, but cannot get it to work any other way. 
AM

justme1968

you can change the command in the setFn. the command from the setList of the readingsProxy does not hate to be identical to the command that is passed to the parent device.

define <proxy> readingsProxy <parent>:mode
attr <proxy> setList on off
attr <proxy> devStateIcon on:on:off off:off:on
attr <proxy> setFn {"mode $VALUE"}


this will turn the simple on and off commands of the readings proxy into an set mode on/off command for the parent device.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

andyclimb

I really appreciate the help.  unfortunately that does not work.

define testproxy readingsProxy mqtt_test2:mode
attr testproxy setList on off
attr testproxy devStateIcon on:on:off off:off:on
attr testproxy setFn {"mode $VALUE"}


this is copied from my them cfg, so it is exactly what i have.   from my post earlier the command needs to be mode, with this code the command is still on and off, which does not work?

any other ideas?

And thank you for helping!

AM

justme1968

sorry. my copy&paste mistake.

setFn hast to be:attr test proxy setFn {"mode $CMD"}

hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

andyclimb

AM

andyclimb

AM

justme1968

hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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