Adding support for Smappee

Thank you for your feedback

Only to give another option to interested people.
With the information of this thread (thanks!) I have added the integration in Node RED. The benefit over do it like native sensors, is that I added a “smoothing” element that takes 10 values and calculates the medium value and outputs only one.
In this way, we receive the same values (one each second) but we reduce a little the overhead modifying the sensor in HA only one each 10 seconds, reducing the history of this sensor, the refreshing, etc.

1 Like

Would you like to share your Node RED flow?
Sounds very interesting!

1 Like

@gizzmo sorry, I didn’t see your reply, I need to change my notifications I think…

Here you have, if it can help someone:

[{"id":"7c133d97.5d12e4","type":"mqtt in","z":"6b0187c1.7dbdd8","name":"Smappe realtime","topic":"servicelocation/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/realtime","qos":"0","datatype":"json","broker":"8983b10f.7332a","x":120,"y":240,"wires":[["add3a5ea.052648","49b36003.5067","b5c928fd.598aa8","b66ce01a.a81f1"]]},{"id":"add3a5ea.052648","type":"smooth","z":"6b0187c1.7dbdd8","name":"Media consumo","property":"payload.totalPower","action":"mean","count":"10","round":"0","mult":"multi","reduce":true,"x":500,"y":160,"wires":[["f95a147f.012cc8"]]},{"id":"49b36003.5067","type":"smooth","z":"6b0187c1.7dbdd8","name":"Media intensidad","property":"payload.channelPowers.0.current","action":"mean","count":"10","round":"0","mult":"single","reduce":true,"x":510,"y":280,"wires":[["41579ee8.6f88f"]]},{"id":"b5c928fd.598aa8","type":"smooth","z":"6b0187c1.7dbdd8","name":"Media voltaje","property":"payload.voltages.0.voltage","action":"mean","count":"10","round":"0","mult":"single","reduce":true,"x":490,"y":220,"wires":[["7c865606.f49248"]]},{"id":"7c865606.f49248","type":"ha-entity","z":"6b0187c1.7dbdd8","name":"Smappee Voltaje","server":"e03e6d0f.b2759","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Smappee Voltaje"},{"property":"device_class","value":"power"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"V"}],"state":"payload.voltages.0.voltage","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":990,"y":220,"wires":[[]]},{"id":"41579ee8.6f88f","type":"change","z":"6b0187c1.7dbdd8","name":"Ajustar unidades","rules":[{"t":"set","p":"payload.channelPowers.0.current","pt":"msg","to":"$round(payload.channelPowers[0].current / 10, 1)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":280,"wires":[["dacd40b.f38f6c"]]},{"id":"dacd40b.f38f6c","type":"ha-entity","z":"6b0187c1.7dbdd8","name":"Smappee Intensidad","server":"e03e6d0f.b2759","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Smappee Intensidad"},{"property":"device_class","value":"power"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"A"}],"state":"payload.channelPowers.0.current","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1000,"y":280,"wires":[[]]},{"id":"f95a147f.012cc8","type":"ha-entity","z":"6b0187c1.7dbdd8","name":"Smappee Consumo","server":"e03e6d0f.b2759","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Smappee Consumo"},{"property":"device_class","value":"power"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"W"}],"state":"payload.totalPower","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1000,"y":160,"wires":[[]]},{"id":"6dfc5cd8.b45b34","type":"mqtt in","z":"6b0187c1.7dbdd8","name":"Smappe aggregated","topic":"servicelocation/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX/aggregated","qos":"0","datatype":"json","broker":"8983b10f.7332a","x":130,"y":460,"wires":[["9baf4022.044a2","931295af.f1d4e8"]]},{"id":"9baf4022.044a2","type":"change","z":"6b0187c1.7dbdd8","name":"Ajustar unidades","rules":[{"t":"set","p":"payload.intervalDatas.0.alwaysOn","pt":"msg","to":"$round(payload.intervalDatas[0].alwaysOn / 1000, 1)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":500,"wires":[["168a717c.0e814f"]]},{"id":"931295af.f1d4e8","type":"change","z":"6b0187c1.7dbdd8","name":"Ajustar unidades","rules":[{"t":"set","p":"payload.intervalDatas.0.channelIntervalDatas.0.averageImportRMSActivePower","pt":"msg","to":"$round(payload.intervalDatas[0].channelIntervalDatas[0].averageImportRMSActivePower / 1000, 1)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":440,"wires":[["17ffae0c.277092"]]},{"id":"17ffae0c.277092","type":"ha-entity","z":"6b0187c1.7dbdd8","name":"Smappee Consumo (5m)","server":"e03e6d0f.b2759","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Smappee Consumo (5m)"},{"property":"device_class","value":"power"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"W"}],"state":"payload.intervalDatas.0.channelIntervalDatas.0.averageImportRMSActivePower","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1010,"y":440,"wires":[[]]},{"id":"168a717c.0e814f","type":"ha-entity","z":"6b0187c1.7dbdd8","name":"Siempre encendido","server":"e03e6d0f.b2759","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Smappee Siempre Encendido"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"W"}],"state":"payload.intervalDatas.0.alwaysOn","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":990,"y":500,"wires":[[]]},{"id":"c1445d6e.de28e","type":"config","z":"6b0187c1.7dbdd8","name":"Constantes y propiedades","properties":[{"p":"POTENCIA_CONTRATADA","pt":"flow","to":"3450","tot":"num"},{"p":"SEGUNDOS_INTERVALO","pt":"flow","to":"10","tot":"num"}],"active":true,"x":160,"y":60,"wires":[]},{"id":"b66ce01a.a81f1","type":"delay","z":"6b0187c1.7dbdd8","name":"Limitar cada 10 seg","pauseType":"rate","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"10","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":510,"y":340,"wires":[["41c20caa.effbd4"]]},{"id":"41c20caa.effbd4","type":"change","z":"6b0187c1.7dbdd8","name":"Ajustar unidades","rules":[{"t":"set","p":"payload.totalImportEnergy","pt":"msg","to":"$round(payload.totalImportEnergy *  0.0000002778, 2)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":340,"wires":[["f096b42d.cf9dd8"]]},{"id":"f096b42d.cf9dd8","type":"ha-entity","z":"6b0187c1.7dbdd8","name":"Smappee Energía Total","server":"e03e6d0f.b2759","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Smappee Energía Total"},{"property":"device_class","value":"power"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"kWh"}],"state":"payload.totalImportEnergy","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1010,"y":340,"wires":[[]]},{"id":"8983b10f.7332a","type":"mqtt-broker","z":"","name":"Home Assistant MQTT","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"e03e6d0f.b2759","type":"server","z":"","name":"Home Assistant","addon":true}]

The texts are in Spanish:

2 Likes

Anyone wants to sell the smappee solar? :wink:

Great work! I was looking for a way to do this but couldn’t come up with one. You might convince me to finally install node-red. Just a pity their MQTT api sucks so much.

You can do the same with Home Assistant filters too: https://www.home-assistant.io/integrations/filter/

And disable the recorder for the original entity.

Hey, did you manage to find a solution for this? would really like to command the smart plugs via HA…

Thanks!

@WimB
I use an mqtt switch to get the state of a smappee smart plug - https://github.com/gieljnssns/My-Hassio-config/blob/765d35b0b51ea5a614e8195dd59b07a7208ad85e/config/devices/switch/smappee/mqtt_smappee.yaml
And I use another template switch to change the state of a smappee plug - https://github.com/gieljnssns/My-Hassio-config/blob/765d35b0b51ea5a614e8195dd59b07a7208ad85e/config/devices/switch/smappee/template_smappee.yaml

guys, got myself a second hand smappee solar, resetted it
i can access webpage, but how to update the firmware? i read before that there are 2.0 updates? but how to get them ?

They update itself. You don’t need to do nothing. I have the same version than you, it was from 15th january 2021.
I don’t know if they are 2.0 versions, they are published somewhere?

Ah ok, gonna install it Monday, thnx

Maybe it was some android app that was released to 2.0

I am just reading the integration…
So there is a local and a cloud (paid) what’s the difference? Is the local one limited to entities?

What’s the cost for the cloud api?

Looks like you have (from the screenshot) a 1st gen device. I would go for local MQTT control, not even sure if the cloud API works with it? Even so local is better and faster.

If you go to advanced in the settings (http://smappeeip/smappee/html password is admin) then click the advanced tick box so you are double advanced :slight_smile: you can enter the address of your MQTT broker or the HA addon.

Then you need to add it to your sensors in your yaml like this

  - platform: mqtt
    name: 'Smappee Grid'
    state_topic: "servicelocation/xxxxxxxxxxxxxxxxxxx/realtime"
    value_template: "{{ value_json.totalPower }}"
    unit_of_measurement: 'W'
    device_class: power
    icon: mdi:current-ac

  - platform: mqtt
    state_topic: "servicelocation/xxxxxxxxxxxxxxxxxxxxxxxxxxx/realtime"
    name: "Smappee Solar"
    unit_of_measurement: "W"
    value_template: "{{value_json.channelPowers[0].power}}"
    device_class: power
    icon: mdi:current-ac

Should be good to go. Side note the sensor ticks every 1 second so your history DB will grow fast either exclude it or smooth it out some way i use a node red smooth for this.

Oh quick edit your firmware and engine are up to date and you knew how to get to the portal as that’s where the screenshot was from :man_facepalming: i’ll leave it there in case it’s useful for someone else

1 Like

Thnx, much appreciated

Btw, is Mqtt still needed? I have turned it on, and home assistant recognized it as an integration… I have not added it , since it’s not yet installed…

Anyway, seems I have a first gen device, is it good? I only paid 50€ for it for the solar version

Any tips are welcome

it’s a great product ii would be lost without mine saves me a lot of money as i have it in lots of node red flows to turn stuff on only when i have solar.

MQTT is a must for gen 1 in my opinion, to grab that data, mix it with smooths and joins in node red and you have lots of information.

Cool, can you give some examples about money saving? What do you turn on automaticly?

I have node red rules that turn on off various different loads depending on the solar export. 2 x 20w power banks where the whole family charge phones, tablets cameras etc they both have ~ 30000mah of storage so can charge everything with out ever using the mains they use the small export loads at about 20w each. I’m working from home at the moment due to covid and so i have 2 laptops on the go most the time my personal one and a work one, the plugs only turn on when there is 70w of export and i work on battery the rest of the time. The house is almost 100 years old and has lime and horsehair plaster it can get damp just from breathing so we have a dehumidifier that one just turns on when we have 250w of export. My man cave / hobby room is a converted coal shed as an annex to the house so it has no heating, i use a 650w oil storage heater again only when i am exporting that much. Finally if i am exporting 1450w the car starts charging using my zappi it then just uses all export upto the 3750w i have of my solar and changes the charge dynamically for the car it is the zappi doing it though not smappee just for the car bit

1 Like

Interesting ideas indeed