sensors.yaml 1.1 KB

12345678910111213141516171819202122232425262728
  1. - platform: sql
  2. db_url: mysql://hassio:hassiopassword@192.168.1.110/RemoteRxLog
  3. queries:
  4. - name: Lux outside the garage
  5. query: "SELECT CAST(AVG(data) AS signed) as data FROM (SELECT data FROM RemoteRxLog.rawTemp WHERE type = 'lux' and data < '65535' ORDER BY id DESC LIMIT 3) items;"
  6. column: 'data'
  7. unit_of_measurement: Lux
  8. - name: Outside temperature
  9. query: "SELECT temp1 FROM RemoteRxLog.temp order by ts desc LIMIT 1;"
  10. column: 'temp1'
  11. unit_of_measurement: C
  12. - name: Piano-lamp repeater status
  13. query: "SELECT IF(onOff>0,'on','off') AS status FROM RemoteRxLog.nexaLog where rxTx='R' and remote_id = '20071094' and button='2' order by ts desc LIMIT 1;"
  14. column: 'status'
  15. - name: Exterior light status
  16. query: "SELECT IF(onOff>0,'on','off') AS status FROM RemoteRxLog.nexaLog where rxTx='R' and remote_id = '20071094' and button='1' order by ts desc LIMIT 1;"
  17. column: 'status'
  18. - platform: mqtt
  19. name: Temperatur Hällby
  20. state_topic: "sensor/outside/temperature"
  21. unit_of_measurement: "°C"