@@ -334,28 +334,73 @@ Note, that this only works correctly, if you hide the sidebar by default, for th
334
334
## Transfer system status data to Home Assistant
335
335
336
336
```
337
- - platform: rest
338
- name: kiosk_sensors
339
- scan_interval: 60
340
- resource: http://192.168.2.38:5000/api/status
341
- json_attributes:
342
- - disk
343
- - temperature
344
- - memory
345
- - cpu
346
- value_template: "OK"
347
-
348
- - platform: template
349
- sensors:
350
- kiosk_temperature:
351
- unique_id: kiosk_temperature
352
- friendly_name: "CPU Temperature"
353
- value_template: "{{ state_attr('sensor.kiosk_sensors', 'temperature')['cpuTemperature'] | round(1) }}"
354
- device_class: temperature
355
- unit_of_measurement: "°C"
356
- kiosk_cpu_percent:
357
- unique_id: kiosk_cpu_percent
358
- friendly_name: "CPU Usage"
359
- value_template: "{{ state_attr('sensor.kiosk_sensors', 'cpu')['cpuUsage'] | round(1)}}"
360
- unit_of_measurement: "%"
337
+
338
+ sensor:
339
+ - platform: rest
340
+ name: kiosk_sensors
341
+ scan_interval: 60
342
+ resource: http://192.168.2.38:5000/api/status
343
+ json_attributes:
344
+ - disk
345
+ - temperature
346
+ - memory
347
+ - cpu
348
+ value_template: "OK"
349
+
350
+ - platform: template
351
+ sensors:
352
+ kiosk_temperature:
353
+ unique_id: kiosk_temperature
354
+ friendly_name: "CPU Temperature"
355
+ value_template: "{{ state_attr('sensor.kiosk_sensors', 'temperature')['cpuTemperature'] | round(1) }}"
356
+ device_class: temperature
357
+ unit_of_measurement: "°C"
358
+ kiosk_cpu_percent:
359
+ unique_id: kiosk_cpu_percent
360
+ friendly_name: "CPU Usage"
361
+ value_template: "{{ state_attr('sensor.kiosk_sensors', 'cpu')['cpuUsage'] | round(1)}}"
362
+ unit_of_measurement: "%"
363
+ ```
364
+
365
+
366
+ ## Turn off kiosk when PC is turned off
367
+
368
+ ```
369
+
370
+ rest_command:
371
+ kiosk_off:
372
+ url: "http://192.168.2.38:5000/api/shutdown"
373
+ method: POST
374
+
375
+ binary_sensor:
376
+ - platform: ping
377
+ host: 192.168.2.35
378
+ name: dev5_ping
379
+ scan_interval: 60
380
+ - platform: template
381
+ sensors:
382
+ dev5_online:
383
+ unique_id: dev5_online
384
+ friendly_name: "DEV5 Online"
385
+ delay_off:
386
+ minutes: 2
387
+ value_template: "{{ states('binary_sensor.dev5_ping')}}"
388
+
389
+ automation
390
+
391
+ - id: '...........'
392
+ alias: kiosk off when DEV5 off
393
+ description: ''
394
+ trigger:
395
+ - platform: state
396
+ entity_id:
397
+ - binary_sensor.dev5_online
398
+ from: 'on'
399
+ to: 'off'
400
+ condition: []
401
+ action:
402
+ - service: rest_command.kiosk_off
403
+ data: {}
404
+ mode: single
405
+
361
406
```
0 commit comments