Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 105521

Update frequency sensor

$
0
0

I have made a sensor that reads the volume* of my AVR from an XML file (with curl via the commandline I can read this XML file several times per second without any problems). It only takes seconds before the sensor is updated. Is there a limit on the sensors?

If set the the sensor on “Scan_interval: 1”, I see that the AVR is requested every second. So that part goes well.
I want that if I raise the volume, the volume number in the sensor also raised. I have a script behind the volume button. This script sets the sound down and does a sensor update at the same time.


part of the button:

      tap_action:
        action: call-service
        service: script.avr_zone2_vol_up
        data: {}



script:

  avr_zone2_vol_up:
    alias: "Script volume up"
    sequence:
      - service: media_player.volume_up
      target:
         entity_id: media_player.denon_avc_x3700h_2
      - service: homeassistant.update_entity
        target:
          entity_id: sensor.avr_zone2_volume



sensor:

  - platform: rest
    scan_interval: 12
    resource: http://<IP-ADDRESS>:8080/goform/formZone2_Zone2XmlStatusLite.xml
    name: avr_zone2_volume
    value_template: "{{ value_json.item.MasterVolume.value }}"

or

  - platform: rest
    name: avr_zone2_volume
    resource: http://<IP-ADDRESS>:8080/goform/formZone2_Zone2XmlStatusLite.xml
    method: GET
    scan_interval: 60  
    value_template: "{{ xml(state).find('.//MasterVolume/value').text }}"
    headers:
      Content-Type: application/xml

*HTTP://:8080/GoForm/Formzone2_Zone2xmlstatuslite.xml

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 105521

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>