Statement to only inlcude Valves

Begonnen von mflammia1, 24 September 2015, 23:58:28

Vorheriges Thema - Nächstes Thema

mflammia1

Hi,

Recently added some code I liberated from the link below and made some minor adjustments so that it would work with my MAX equipment. The problem I am having is that the below example is reading all my MAX valves AND thermostats, and not sure how to separate it, say so only my valves are shown. Below is an example of the reading group, and also a snippet of my Valve and Wall Thermostat config.

http://www.fhemwiki.de/wiki/ReadingsGroup

define Heizungswerte readingsGroup <%sani_heating>,<Valve>,<SetTemp>,<Temp>,<Mode>,<Battery> TYPE=MAX:valveposition,desiredTemperature,temperature,mode,battery
attr Heizungswerte mapping %ALIAS
attr Heizungswerte nameStyle style="color:yellow;;font-weight:bold"
attr Heizungswerte room Heizung
attr Heizungswerte valueFormat {'temperature' => "%.0f °C", 'desiredTemperature' => "%.0f °C", 'valveposition' =>"%.0f %%", 'maxValveSetting' =>"%.0f %%" }
attr Heizungswerte valueIcon {'battery.ok' => 'batterie@lightgreen', 'battery.low' => 'batterie@red'}
attr Heizungswerte valueStyle { if($READING eq "temperature" && $VALUE > 20){ 'style="color:green;;font-weight:bold"' }elsif( $READING eq "temperature" && $VALUE <= 20 ){ 'style="color:blue"' }elsif( $READING eq "temperature" && $VALUE > 23 ){ 'style="color:red"' }else{ 'style="color:gray"' } }
attr Heizungswerte valueIcon {'battery.ok' => 'batterie@lightgreen', 'battery.low' => 'batterie@red'}



###Bathroom Wall Thermostat
define MAX_Bathroom_Thermostat MAX WallMountedThermostat 0f78d8
attr MAX_Bathroom_Thermostat IODev cm
attr MAX_Bathroom_Thermostat alias Bathroom Thermostat
attr MAX_Bathroom_Thermostat group Bathroom
attr MAX_Bathroom_Thermostat icon hm-tc-it-wm-w-eu
attr MAX_Bathroom_Thermostat room Bathroom,MAX,Thermostats
define FileLog_MAX_Bathroom_Thermostat FileLog ./log/MAX_0f78d8-%Y.log MAX_Bathroom_Thermostat
attr FileLog_MAX_Bathroom_Thermostat fm_type [{"title":"Temperature","id":"graph-temp","min":"auto:0","max":"auto:20","col":"a90000","h":2}]
attr FileLog_MAX_Bathroom_Thermostat group Bathroom
attr FileLog_MAX_Bathroom_Thermostat logtype text
attr FileLog_MAX_Bathroom_Thermostat room MAX

###Bathroom TVR
define MAX_Bathroom_TVR MAX HeatingThermostat 0ddeb3
attr MAX_Bathroom_TVR IODev cm
attr MAX_Bathroom_TVR alias Bathroom TVR
attr MAX_Bathroom_TVR fm_type desiredtemp,tempbutton,actuators
attr MAX_Bathroom_TVR group Bathroom
attr MAX_Bathroom_TVR icon hc_wht_regler
attr MAX_Bathroom_TVR room Bathroom,MAX
define FileLog_MAX_Bathroom_TVR FileLog ./log/MAX_0ddeb3-%Y.log MAX_Bathroom_TVR
attr FileLog_MAX_Bathroom_TVR fm_type [{"title":"Temperature","id":"graph-temp","min":"auto:0","max":"auto:20","col":"a90000","h":2}]
attr FileLog_MAX_Bathroom_TVR group Bathroom
attr FileLog_MAX_Bathroom_TVR logtype text
attr FileLog_MAX_Bathroom_TVR room MAX


Many thanks in advance.

rudolfkoenig

You have to find an attribute/reading, which will separate the thermostat from the valve, then replace TYPE=MAX in the readingsgroup definition with attributename=value. You can test the filter with the list command, e.g. check the output of "list TYPE=MAX" first, and then your new filter. You can use the name of the device for this purpose (.*Thermostat), set the comment attribute (comment=Thermostat) or add your own userDefined attribute.

justme1968

type=HeatingThermostat should work for the valves as well as TYPE=MAX:FILTER=type=HeatingThermostat

for the thermostats use WallMountedThermostat instead of HeatingThermostat.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

mflammia1

Brilliant! Thanks for your support. Worked a treat!