August 13, 20206 yr Good day All is there a way to have home assistant monitor my prepaid electricity box so it can warn me when my electricity is running low or even top up the meter somehow (this is probably just a pip dream)
August 14, 20206 yr If you can interface with the meter and run commands, then it is possible. Most prepaid meters I have seen don't have an easy available interface.
August 14, 20206 yr I did once see a person who stuck a photo diode directly over the LED on his pre-paid meter to count pulses. The LED on the meter flashes at something like 1000 pulses per kWh. Then he wrote some software that tracked his usage based on the count. Unfortunately you then have to manually update the remaining kWh when you recharge your meter.
August 14, 20206 yr You can add a webcam/camera to the display. I have seen some HA component that can interpret the 8 segment display. And from there you can derive the value.
August 14, 20206 yr 2 hours ago, Stanley said: I did once see a person who stuck a photo diode directly over the LED on his pre-paid meter to count pulses. The LED on the meter flashes at something like 1000 pulses per kWh. I've done that, back when I was developing the pulse meter implementation for the Venus-GX (it was for water pumps... but this seemed like a good way to test it): Also, I made this some years ago, or rather, I fixed it up so it works again, an Android app that uses the camera to count pulses. 10649264_10152684751795619_86532852_n.mp4 There is no intelligence in it, it simply uses the average value of the whole photo frame, ie you need to hold the camera close to the LED. I wanted to make it so it can also upload the value to "the cloud" but I kinda lost interest when I found out you can just punch #1# into the conlog to get a power reading.
August 14, 20206 yr https://esphome.io/cookbook/power_meter.html Have a look at that, I built one and compared the readings to an Efergy and it was spot on, they're cheap to build using a nodemcu.
February 22, 20224 yr I was also looking for a solution here If you have some energy meter (measuring total consumed kWh). You can try the following (I use it in packages\prepaid.yaml). My energy from the grid is measured by the sunsynk inverter, but any meter should work You can now create an automation if sensor.prepaid_units_left<20 to send you a message etc... # A sensor that indicates how many prepaid units you have left # # 1. Enter the units using "input_test.prepaid_units" # 2. An automation save the sum of the enetered units + grid total # 3. The sensor displays the saved value - the current grid total automation: - id: "prepaid-set-units" alias: Prepaid - set units initial_state: true trigger: - platform: state entity_id: sensor.prepaid_units_left condition: "{{ states('sensor.prepaid_units_left') | float < 0 }}" action: - service: input_text.set_value target: entity_id: input_text.prepaid_units data: value: > {% set units = states('input_text.prepaid_units') | float %} {% set total = states('sensor.ss_total_grid_import') | float %} {{ (units+total) | round(2) }} input_text: prepaid_units: name: Enter Prepaid units from meter pattern: '\d+(\.\d+)?' mode: password icon: mdi:home-lightning-bolt-outline min: 1 max: 10 template: - sensor: - name: "Prepaid units left" icon: mdi:home-lightning-bolt-outline unit_of_measurement: "kWh" state: > {% set units = states('input_text.prepaid_units') | float %} {% set total = states('sensor.ss_total_grid_import') | float %} {% if (units-total) > 999 %}999.999{% else %}{{ (units-total) | round(1) }}{% endif %}
August 22, 20233 yr Hi @kellerza Digging this one up, hope you don't mind. I've recently gone solar/prepaid so would like to monitor my PP balance in my HA dashboard. Is your code still relevant or has there been updates? Thanks
February 26, 20242 yr On 2022/02/22 at 8:54 PM, kellerza said: I was also looking for a solution here If you have some energy meter (measuring total consumed kWh). You can try the following (I use it in packages\prepaid.yaml). My energy from the grid is measured by the sunsynk inverter, but any meter should work You can now create an automation if sensor.prepaid_units_left<20 to send you a message etc... Sorry but how do you implement this? I have tried this but getting "unavailable". I have the Sunsynk inverter in HA.
February 26, 20242 yr On 2022/02/22 at 8:54 PM, kellerza said: If you have some energy meter (measuring total consumed kWh). You can try the following (I use it in packages\prepaid.yaml). My energy from the grid is measured by the sunsynk inverter, but any meter should work The useage your inverter sees is not necessarily the same amount by which your prepaid balance changes. I say this from personal experience. So if you want to track the inverter's net draw from the grid then your method is a good one. If you want to track the actual balance on the meter then we're back to interfacing with the meter itself.
February 29, 20242 yr On 2024/02/26 at 2:19 PM, McGuywer said: Sorry but how do you implement this? I have tried this but getting "unavailable". I have the Sunsynk inverter in HA. @McGuywer did you manage to get it going.
March 4, 20242 yr On 2024/02/29 at 1:23 PM, debug78 said: @McGuywer did you manage to get it going. Nope, not yet. It keeps on saying unavailable.
March 10, 20242 yr On 2024/03/06 at 8:09 AM, debug78 said: @kellerza can you give us a step by step on the implementation thanks in advance. 1. Read up on config packages here - config-packages 2. Save the code above in a "package" file 3. Add your elements to your HA dashboard On 2024/02/26 at 3:20 PM, Bobster. said: The useage your inverter sees is not necessarily the same amount by which your prepaid balance changes. I say this from personal experience. So if you want to track the inverter's net draw from the grid then your method is a good one. If you want to track the actual balance on the meter then we're back to interfacing with the meter itself. If your inverter's mode (load_limit sensor) is set to "Zero export" and your inverter's CT sensor is working, then total_grid_import is very close. If you set load_limit to only essentials or to export then the inverter does not include the non-essential power draw. Why you should ask Sunsynk, but so far, they have told us to update the inverter firmware, without any success.
March 11, 20242 yr Sorry @kellerza, I am still struggling: Quote root@server:/data/docker/homeassist# cat config/packages/prepaid.yaml # A sensor that indicates how many prepaid units you have left # # 1. Enter the units using "input_test.prepaid_units" # 2. An automation save the sum of the enetered units + grid total # 3. The sensor displays the saved value - the current grid total automation: - id: "prepaid-set-units" alias: Prepaid - set units initial_state: true trigger: - platform: state entity_id: sensor.prepaid_units_left condition: "{{ states('sensor.prepaid_units_left') | float < 0 }}" action: - service: input_text.set_value target: entity_id: input_text.prepaid_units data: value: > {% set units = states('input_text.prepaid_units') | float %} {% set total = states('sensor.sunsynk_total_grid_import') | float %} {{ (units+total) | round(2) }} input_text: prepaid_units: name: Enter Prepaid units from meter pattern: '\d+(\.\d+)?' mode: password icon: mdi:home-lightning-bolt-outline min: 1 max: 10 template: - sensor: - name: "Prepaid units left" icon: mdi:home-lightning-bolt-outline unit_of_measurement: "kWh" state: > {% set units = states('input_text.prepaid_units') | float %} {% set total = states('sensor.ss_total_grid_import') | float %} {% if (units-total) > 999 %}999.999{% else %}{{ (units-total) | round(1) }}{% endif %} root@server:/data/docker/homeassist# What am I missing?
March 12, 20242 yr On 2024/03/11 at 11:59 AM, McGuywer said: What am I missing? Filter on total_grid_import?
March 15, 20242 yr On 2024/03/12 at 7:59 PM, kellerza said: Filter on total_grid_import? Sorry, but I am not following? I am not sure what to do?
March 17, 20242 yr On 2024/03/15 at 9:52 AM, McGuywer said: Sorry, but I am not following? I am not sure what to do? @McGuywer you need to change sensor.sunsynk_total_grid_import to your sensor entity then in works perfectly. Thanks @kellerza
March 19, 20242 yr Much appreciated, it is working now. I missed the second: {% set total = states('sensor.ss_total_grid_import') | float %}
June 5, 20242 yr I found this very useful and decided to put together a video on installing it as some people, including myself :-), were having a few issues setting it up. I hope that the video helps
June 6, 20242 yr On 2024/06/05 at 12:54 PM, Sc00bs said: I found this very useful and decided to put together a video on installing it as some people, including myself :-), were having a few issues setting it up. I hope that the video helps @Sc00bs Thanks for this. Unfortunately I cannot get this to work. I had to manually create the templates as the code was giving errors. I am actually using the Home | Home Assistant Glow 🌟 (glow-energy.io) mentioned by @hilt_ctn above as the total grid use number. I am almost certainly doing something wrong because the nothing updates. I suspect the issue is in the script but i can't see what is wrong there - alias: Update Prepaid Units sequence: - service: input_number.set_value target: entity_id: input_number.enter_prepaid_units_from_meter data: value: '{{ states(''input_number.enter_prepaid_units_from_meter'') | float }}' - service: input_number.set_value target: entity_id: input_number.prepaid_units_left data: value: '{{ states(''sensor.prepaid_units_left'') | float }}' - service: input_number.set_value target: entity_id: input_number.initial_prepaid_units data: value: '{{ states(''input_number.initial_prepaid_units'') | float }}' - service: input_datetime.set_datetime target: entity_id: input_datetime.last_update data: datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}' mode: single
June 6, 20242 yr On 2024/04/09 at 12:06 PM, hilt_ctn said: Came across this today - Home Assistant Glow I have just installed this on my meter. Seems to be tracking my meter much better than IAMMETER. Will feedback after a bit more time testing. I fount it very hard to get the exact LM393 Photodiode. I eventually found it at Leobot Electronics (Pretoria). Quite expensive though when you add on postage to the Cape. Edited June 8, 20242 yr by rgt.dnl
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.