How to change values of Zwave device?

I have a neo coolcam Zwave power plug (a clone of Aeotec).

I need to read and then reset each day the value of energy consumption (to have a daily value).
Read is easy but resetting would mean send from HASS to the device a command, but how to do it, is it possible?

Here is the manual of the power plug

Research set_config_parameter.

But I don’t understand

action:
service: zwave.set_config_parameter
…??

can you give me an example?

I don’t know how to do this

“Lets the user set a config parameter to a node. NOTE: Use string for list values. For all others use integer.”

https://community.home-assistant.io/search?q=set_config_parameter

Or specifically:

  action:
    service: zwave.set_config_parameter
    data_template: {
      "node_id": 20,
      "parameter": 8,
      "value": 2
      }
1 Like

Thanks, how would you store the value of energy of the previous day?

also which parameters … no parameter in this pdf says which is the energy reset …

1 Like

Per the manual there is no command to reset the usage.
If you want a daily usage report, you’ll have to use a script and math it out.

A script would do?

Don’t know how to do it, can you give me an example?

Actually looks like you can do it via the history component:

Example:

sensor:
  - platform: history_stats
    name: Power Usage Today
    entity_id: zwave.your_device_name
    state: 'on'
    type: time
    end: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
    duration:
      hours: 24

Replace the state with what ever state you’re tracking.

Hope this puts you in the right direction.

1 Like

thanks trying now.

Like this shows the last 24 hours, like every minute is the last 24 hours correct?

I would rather have a value per day (from 00:00 to current time, and maybe retain the value of previous days)

What I posted would be the previous day’s worth of usage. So to do from 00:00 to ‘now’ it’d be like this:

sensor:
  - platform: history_stats
    name: Power Usage Today
    entity_id: zwave.your_device_name
    state: 'on'
    type: time
    start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
    end: '{{ now() }}'

Not sure I understand. Let’s make an example.

Today is 10:25 it shows from 00:00 to 10:25 or from 10:24 previous day to 10:25 today? (first is ok for me, second no)

My 2nd post would show you “from 00:00 to now” whatever your current time is :slight_smile:

Hi, I receive 0 all time …

Cattura

Do you have the correct entity being monitored?

under sensor:

  - platform: history_stats
    name: Air Gilma Daily Energy last 24h
    entity_id: sensor.neo_coolcam_power_plug_12a_energy
    state: 'on'
    type: time
    end: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
    duration:
      hours: 24
  - platform: history_stats
    name: Air Gilma Daily Energy from 00:00 to now
    entity_id: sensor.neo_coolcam_power_plug_12a_energy
    state: 'on'
    type: time
    start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
    end: '{{ now() }}

Perhaps @bokub may have some insight if this is possible with the component.

@anon35356645 this won’t work because the state that you want tracked is a numerical value, not ‘on’. I don’t think think component can track changing numerical values.