Hi Community,
after updating to the last ha version my template construct showing in/out traffic with snmp and template is not working anymore. I guess I have a problem with entity_id in sensor, but I don’t get to the right hook:
sensor:
# -- Define the raw SNMP counters
- platform: snmp
name: pfSense NIC WAN In Counter Raw
host: 192.xxxxx
community: hassio
baseoid: 1.3.6.1.2.1.2.2.1.10.2
- platform: snmp
name: pfSense NIC WAN Out Counter Raw
host: 192.xxxxx
community: hassio
baseoid: 1.3.6.1.2.1.2.2.1.16.2
# -- Define the statistics enabled counters
- platform: statistics
name: pfSense NIC WAN In Counter
entity_id: sensor.pfsense_nic_wan_in_counter_raw
sampling_size: 2
max_age:
minutes: 5
- platform: statistics
name: pfSense NIC WAN Out Counter
entity_id: sensor.pfsense_nic_wan_out_counter_raw
sampling_size: 2
max_age:
minutes: 5
# -- Define the actual sensor templates you'll use
- platform: template
sensors:
pfsense_nic_wan_in_mbps:
icon_template: mdi:cloud-download-outline
friendly_name: 'pfsense WAN Traffic In'
unit_of_measurement: 'Mbps'
**entity_id: sensor.pfsense_nic_wan_in_counter**
value_template: >
{% if state_attr('sensor.pfsense_nic_wan_in_counter','change_rate') > 0 %}
{{ (((state_attr('sensor.pfsense_nic_wan_in_counter','change_rate')|float)*8)/1000000)|round(2) }}
{% else %}
0
{% endif %}
pfsense_nic_wan_out_mbps:
icon_template: mdi:cloud-upload-outline
friendly_name: 'pfsense WAN Traffic Out'
unit_of_measurement: 'Mbps'
**entity_id: sensor.pfsense_nic_wan_out_counter**
value_template: >
{% if state_attr('sensor.pfsense_nic_wan_out_counter','change_rate') > 0 %}
{{ (((state_attr('sensor.pfsense_nic_wan_out_counter','change_rate')|float)*8)/1000000)|round(2) }}
{% else %}
0
{% endif %}
The
sensor.pfsense_nic_wan_in_counter_raw
sensor.pfsense_nic_wan_out_counter_raw
are set,
also
sensor.pfsense_nic_wan_out_counter
sensor.pfsense_nic_wan_in_counter
but in the frontend
sensor. pfsense_nic_wan_in_mbps
sensor. pfsense_nic_wan_out_mbps
now is unavailable.
I need help, I don’t get it…
Thank you!