Dear Forum!
It’s a bit of a noob-question, but I’m having troubles to get two Rest-Sensors to run.
Both of them scan JSON-Data. On their own, they both work perfeclty fine and I can display the data.
But when activating both in my config.yaml, the first one (“sonnenbatterie34”) isn’t showing any new data?
config.yaml:
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor:
# Sonnenbatterie JSON via API V2
# Für Vorlage siehe https://community.home-assistant.io/t/sonnenbatterie-with-apiv2-webhook/264907
- platform: rest
name: sonnenbatterie34
scan_interval: 20
resource: http://*IP*:80/api/v2/status
headers:
Authorization: *API-Key*
json_attributes:
- Apparent_output
- BackupBuffer
- BatteryCharging
- BatteryDischarging
- Consumption_W
- Fac
- FlowConsumptionBattery
- FlowConsumptionGrid
- FlowConsumptionProduction
- FlowGridBattery
- FlowProductionBattery
- FlowProductionGrid
- GridFeedIn_W
- IsSystemInstalled
- OperatingMode
- Pac_total_W
- Production_W
- RSOC
- Sac1
- Sac2
- Sac3
- SystemStatus
- Timestamp
- USOC
- Uac
- Ubat
- dischargeNotAllowed
- generator_autostart
value_template: '{{ value_json.sonnenbatterie34 }}'
- platform: template
sensors:
sonnenbatterie34_apparent_output:
friendly_name: 'Apparent_output'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["Apparent_output"] }}'
sonnenbatterie34_backupbuffer:
friendly_name: 'BackupBuffer'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["BackupBuffer"] }}'
sonnenbatterie34_consumption_w:
friendly_name: 'Verbrauch (W)'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["Consumption_W"] }}'
unit_of_measurement: W
device_class: power
sonnenbatterie34_fac:
friendly_name: 'Wechselstromfrequenz (Hz)'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["Fac"] }}'
unit_of_measurement: Hz
sonnenbatterie34_gridfeedin_w:
friendly_name: 'Einspeisung (W)'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["GridFeedIn_W"] }}'
unit_of_measurement: W
device_class: power
sonnenbatterie34_issysteminstalled:
friendly_name: 'IsSystemInstalled'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["IsSystemInstalled"] }}'
sonnenbatterie34_operatingmode:
friendly_name: 'OperatingMode'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["OperatingMode"] }}'
sonnenbatterie34_pac_total_w:
friendly_name: 'Wechselrichter (W)'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["Pac_total_W"] }}'
unit_of_measurement: W
device_class: power
sonnenbatterie34_production_w:
friendly_name: 'Erzeugung (W)'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["Production_W"] }}'
unit_of_measurement: W
device_class: power
sonnenbatterie34_rsoc:
friendly_name: 'RSOC'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["RSOC"] }}'
unit_of_measurement: '%'
sonnenbatterie34_sac1:
friendly_name: 'Sac1'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["Sac1"] }}'
sonnenbatterie34_sac2:
friendly_name: 'Sac2'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["Sac2"] }}'
sonnenbatterie34_sac3:
friendly_name: 'Sac3'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["Sac3"] }}'
sonnenbatterie34_systemstatus:
friendly_name: 'SystemStatus'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["SystemStatus"] }}'
sonnenbatterie34_timestamp:
friendly_name: 'Ablesedatum'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["Timestamp"] }}'
sonnenbatterie34_usoc:
friendly_name: 'SOC Akku'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["USOC"] }}'
unit_of_measurement: '%'
sonnenbatterie34_uac:
friendly_name: 'Wechselstrom-Spannung (V)'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["Uac"] }}'
unit_of_measurement: V
device_class: voltage
sonnenbatterie34_ubat:
friendly_name: 'Batterie-Spannung (V)'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["Ubat"] }}'
unit_of_measurement: V
device_class: voltage
binary_sensor:
- platform: template
sensors:
sonnenbatterie34_flowconsumptionbattery:
friendly_name: 'FlowConsumptionBattery'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["FlowConsumptionBattery"] }}'
sonnenbatterie34_flowconsumptiongrid:
friendly_name: 'FlowConsumptionGrid'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["FlowConsumptionGrid"] }}'
sonnenbatterie34_flowconsumptionproduction:
friendly_name: 'FlowConsumptionProduction'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["FlowConsumptionProduction"] }}'
sonnenbatterie34_flowgridbattery:
friendly_name: 'FlowGridBattery'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["FlowGridBattery"] }}'
sonnenbatterie34_flowproductionbattery:
friendly_name: 'FlowProductionBattery'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["FlowProductionBattery"] }}'
sonnenbatterie34_flowproductiongrid:
friendly_name: 'FlowProductionGrid'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["FlowProductionGrid"] }}'
sonnenbatterie34_batterycharging:
friendly_name: 'BatteryCharging'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["BatteryCharging"] }}'
sonnenbatterie34_batterydischarging:
friendly_name: 'BatteryDischarging'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["BatteryDischarging"] }}'
sonnenbatterie34_dischargenotallowed:
friendly_name: 'dischargeNotAllowed'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["dischargeNotAllowed"] }}'
sonnenbatterie34_generator_autostart:
friendly_name: 'generator_autostart'
value_template: '{{ states.sensor.sonnenbatterie34.attributes["generator_autostart"] }}'
sensor:
# Ökofen JSON
- platform: rest
name: oekofen34
scan_interval: 20
resource: http://*IP*:*Port*/*Secret*/all
json_attributes:
- system
- weather
- forecast
- pe1
- error
#value_template: "OK"
value_template: '{{ value_json.oekofen34 }}'
- platform: template
sensors:
oekofen34_l_temp_act:
value_template: "{{ state_attr('sensor.oekofen34', 'pe1')['L_temp_act'] | multiply(0.1) }}"
friendly_name: 'L_temp_act'
device_class: temperature
unit_of_measurement: C
oekofen34_l_temp_set:
value_template: "{{ state_attr('sensor.oekofen34', 'pe1')['L_temp_set'] | multiply(0.1) }}"
friendly_name: 'L_temp_set'
device_class: temperature
unit_of_measurement: C
If just using just one of the sensors “sonnenbatterie34” or “oekofen34” they work, togehter not.
Can you help me figuring out my mistake?
Kind regards,
gstoetti94