You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECTtimestamp/1000as time_sec,
data.valueas value,
properties.valueas metric
FROM data
LEFT JOIN properties ON (properties.entity_id=data.channel_id)
LEFT JOIN entities ON (entities.id=data.channel_id)
WHERE
(channel_id =1|| channel_id =2|| channel_id =3) ANDtimestamp>= $__unixEpochFrom()*1000ANDtimestamp<= $__unixEpochTo()*1000ANDproperties.pkey='title'ORDER BYtimestampASC
Using channel names
SELECTtimestamp/1000as time_sec,
data.valueas value,
properties.valueas metric
FROM data
LEFT JOIN properties ON (properties.entity_id=data.channel_id)
LEFT JOIN entities ON (entities.id=data.channel_id)
WHERE
(properties.value="Flur"||properties.value="Werkstatt" ) ANDtimestamp>= $__unixEpochFrom()*1000ANDtimestamp<= $__unixEpochTo()*1000ANDproperties.pkey='title'ORDER BYtimestampASC
Using UUID
SELECTtimestamp/1000as time_sec,
data.valueas value,
properties.valueas metric
FROM data
LEFT JOIN properties ON (properties.entity_id=data.channel_id)
LEFT JOIN entities ON (entities.id=data.channel_id)
WHERE
(uuid ="12345678-1234-1234-1234-1234567890ab"|| uuid ="12345678-1234-1234-1234-1234567890ac" ) ANDtimestamp>= $__unixEpochFrom()*1000ANDtimestamp<= $__unixEpochTo()*1000ANDproperties.pkey='title'ORDER BYtimestampASC
Good catch, I updated the gist according to your suggestion.