Autor Thema: Advanced ReadingsGroup  (Gelesen 228 mal)

Offline andyclimb

  • Full Member
  • ***
  • Beiträge: 141
Advanced ReadingsGroup
« am: 22 Juni 2017, 14:06:08 »
I have an MQTT device that creates the following readings `IP` and 'state`.  I've previously created a readingsGroup that creates URLs for each of the devices by modifying the %READING in value format. 

What I would love to do it combine the two, so that the link is displayed to the device, and when clicked opens up the IP, but the colour is dependent on if the status is online, or disconnected.

At the moment I have this:
defmod MQTT_IPs readingsGroup mqtt_.*:IP.* mqtt_.*:status.*
attr MQTT_IPs alias ESP DEVICE LIST
attr MQTT_IPs mapping {state => "<a href='http://$VALUE' target=\"_blank\">$DEVICE</a>"}
attr MQTT_IPs nolinks 1
attr MQTT_IPs notime 1
attr MQTT_IPs valueFormat 1

which does not work. 
AM

 

decade-submarginal