How to displays deCONZ REST API Sensor JSON Data into HA Home Page?

Hi all,

I would like to displays deCONZ sensors JSON data (For example: battery level) into HA Home Page.

Noting that deCONZ HA Integrations plugin can get some sensors data, but not all sensors data. Therefore, I can only get these remaining sensors data via REST API.

I successfully get all my sensors data via REST API as mentioned in deCONZ REST API documentation page.

The results are in JSON format.

However, how could I displays sensor JSON data in HA Home Page?

Thanks.

What data are you missing?

Hi Robban,

Kindly refer to below comparison table between Home Assistant, deCONZ Phoscon App and deCONZ API:

Note: Parameter shown in Home Assistant here means that the parameter can be easily seen and monitor in History tab, using a graph.

Primarily what I want is the battery level for all sensors except Vibration Sensor, and moving state for Vibration Sensor. Other parameters might need in the future, but can be neglected for now.

Could advise on this?

Thanks.

1 Like

Batterylevel is added as an attribute to all entities that report battery so you should have it readily available in home assistant. You can probably use a template sensor to get its own entity.

I started improving each sensors extra parameters in the library some time ago. They are not available from home assistant yet though

1 Like

Thanks for the advice.

Will give it a try using the template sensor for getting batterylevel entity.

This means that moving state for Vibration Sensor is not yet supported now, right?

It is represented as an event in hass. Just like remotes

Noted it is a event.

But how could I do to display this event in HA home page?

Now I tried to display all sensor data, but no idea how to display the event of Vibration Sensor, as per below:
HA%20Vibration%20Sensor%20Moving%20State

I don’t know. Is it relevant to show?

Not sure about others, but this event is relevant for me to see and monitor.

The event id you mentioned is refer to this?

image

In fact, I just wanna to show this vibration_sensor state to either On (vibration detected) or Off (vibration clear) mentioned in vibration device class of Binary sensor - Home Assistant, as per screenshot below:

So, I have added sensors.vibration_sensor using template sensor code below:

  • platform: template
    sensors:
    vibration_sensor:
    friendly_name: “Vibration Sensor”
    value_template: “{{ state_attr(‘sensor.vibration_sensor_battery_level’, ‘event_id’) }}”

But, the state of vibration sensor is not what I expected, as per screenshot below:

FYI. I have solved battery level displaying issue by using template sensor. Only left this vibration sensor state value part.

Thanks.