REST sensor to 2nd HA instance / attributes not effective

Hello,

I am implementing a rest sensor to connect a remote HA “slave” entity to my main instance.

sensor:
  - platform: rest
    resource: https://IP:8123/api/states/sensor.philips_aj7010
    name: Philips AJ7010
    unique_id: aj7010_1
    value_template: '{{ value_json.state }}'
    json_attributes:
      - attributes
    headers:
      Authorization: Bearer ...

The sensor’s attributes seem correct in my main HA instance, the state_class, the unit, …, are well defined:

However, I cannot get a History curve card, only a state bar ?

To enable a History curve, I have to redefine the state_class into the rest sensor definition:

sensor:
   - platform: rest
     resource: https://IP:8123/api/states/sensor.philips_aj7010
     name: Philips AJ7010
     state_class: measurement
     

What can be wrong ?

Thx

I don’t think this is doing what you think it is.

I created (and still use) an integration to do “master/slave” HA through MQTT:

It handles all this automagically :wink: