Laundrify in Home Assistant

Clicked on it and read it.
The screenshot shows how I added the code provided by you. In the links provided, I can’t find any other information that will help the sensor.trockner to show up as an entity that can be used in the energy dashboard.

Sorry for not getting it right, but as I mentioned earlier, I’m not familiar with customizing and coding.

Thanx for the help anyway.

Not familiar is standard at the beginning. No problem. But read and try is supposed to be required. Did you see

image

in the second link?

And did you try to add

  customize:
    sensor.trockner:
      state_class: total_increasing
      device_class: energy

to your configuration.yaml accodingly instead of adding it to your sensor, where it is not supported? Restart and see if it solves your demand.

Important see/use the same indention as in the screenshot. Two spaces before customize

My code now looks like this
Screenshot 2024-04-03 090056

The icon of Trockner and Waschmaschine changed to the one used in the code. That implies to me, the code is working.
Unfortunately the sensors still do not show up in the energy dashboard. I can’t add them to track the energyconsumption.

Should work. Try another restart and then add it via the add-button.

Otherwise send a screenshot from the sensor details in developer tools.

e.g.

Is the sensor really delivers W? And not Wh? I’m not using it anymore.

If yes, then you need another one. Helper → Rieman Integral (left rieman sum) with source of your sensor. And use this instead for the energy dashboard.

1 Like

I’m pretty new to HA, but generally do know my way around code and also own two Laundrify devices.

So I’m trying to get a start on this and will try to go from the last comment about the Rieman Integral.

But currently I’m wondering, if I can add the rest sensor using the UI or whether I have to edit a YAML file for it.

//Edit: It seems as these can only be added using the configuration.yaml. So I will get to it once I’ll be at home in a few days.

Using the left Riemann sum is working well. There only is a warning regarding the device class:
grafik

So, for everyone else interested in using this, I just took the example from above:

sensor:

   - platform: rest
     name: "Waschknecht"
     resource: "http://172.16.50.32/status"
     value_template: '{{ value_json["power"]["watts"] }}'
     unit_of_measurement: "W"
     scan_interval: 30
     icon: mdi:washing-machine

And the configuration of the Riemann

Where I would need help though, is how to add my second Laundrify device, used for the dryer.

If I just copy the snippet again and change the name and IP both sensors are gone.

Edit:

Got it!

My new config looks like this:

   - platform: rest
     name: "Waschknecht"
     resource: "http://172.16.50.32/status"
     value_template: '{{ value_json["power"]["watts"] }}'
     unit_of_measurement: "W"
     scan_interval: 30
     icon: mdi:washing-machine

   - platform: rest
     name: "Trockner"
     resource: "http://172.16.50.47/status"
     value_template: '{{ value_json["sensor"]["power"] }}'
     unit_of_measurement: "W"
     scan_interval: 30
     icon: mdi:tumble-dryer

Notice the different JSON paths for the two devices. The first one, “Waschknecht”, is the original Laundrify. The second, “Trockner”, is the newer Laundrify Mini. Their RESTful endpoints provide different JSON payloads.

So, if anyone is interested in more details, just ask or send me a PN.

Left Riemann Sum…worked for me. Thanks for the support.

@Hoempi Big thank you for all your input. This worked very well for me.

@xlarry Just curious: Why does your integration not simply consume the information from the local API? As this discussion shows, it would allow to also get power consumption, remove dependency on cloud connections and also reduce API calls to your cloud backend (which may incurr costs for you).

Any updates when the power consumption will be added to the HA integration?

Would be a great feature.

Hey everybody,

first of all: the power and energy consumption has been merged and should be available in the upcoming HA release (2024.10). Sorry for the exceptionally long time it took to release this feature - we will try to move faster in the future!

@Flamacue the detection mechanism has been implemented on server-side (not in the firmware of the power plug), so the cycle state is not available in the local API of the power plug. The latest power measurements however will be pulled directly from the power plug.

Hello xlarry,

really good news. Is there a way to count the cycles (per week, pwe month)?

Greetings

Counting the cycles might be possible using a template sensor like the following:

template:
  - trigger:
      - platform: state
        entity_id: binary_sensor.meine_waschmaschine
        from: "on"
        to: "off"
    sensor:
      - name: "Cycle Counter"
        unique_id: "cycle_counter"
        state: >
          {{ (states('sensor.cycle_counter') | int(0)) + 1 }}

Please note that I did not test/validate the above given config - but it might be a good start. If it doesn’t work on first try, the corresponding docs might be helpful :slight_smile:

You could add a utility meter to count cycles within a specific period.

Thats’s what I was trying, but couldn’t get it working due to my lack of understanding what to do.

You offers information about cycles etc. in the laundrify app. Any Chance we see these information in HA?

I’m sure the community can help if you let us know where exactly you’re stuck :slight_smile:

I got the following sensor after adding the above given config (it started to count after adding the config. Also, the weekly counter just got reset this morning, which is why it shows 0):

grafik

Talking about providing further data to HA: what exactly are you missing? Please be as specific as possible - if there is anybody else requesting the same feature, we’ll be happy to consider the implementation :slight_smile:

Thanks for your help, unfortunately I don’t know how to create a templeate like the above. When I’m trying to use the code above I’m getting an error which I don’t understand.

I think I just leave it like that. Thanks for your support.