tl;dr: how can I easily poll my Fibaro Wall Plug’s power usage every 10 seconds or so, save the data and plot this in a graph? Just need to do this a couple of times, not everyday.
On the top of my wishlist for using HA is getting a push message from my dumb laundry machine and dryer are ready doing their thing. The setup I’ve chosen is to use Fibaro Wall Plugs, let HA monitor the power usage and figure out when the machine is done. Like, trigger an automation when power peaks and call an action when it drops below a certain threshold for a couple of minutes which means it’s ready. Then, send a push message
However, to do this I need the right digits for different programs we use and that’s what my question is about. I need a profile of how much power certain programs use. My idea is to poll the Fibaro data every 10 or 15 seconds, save this to a file or database, and plot this in a graph. From there I can find the right numbers to create the right automation script. What method would you advice? Relatively noobish to HA and a mediocre Linux user, although I like a good challenge. Thanks a lot in advance!
I did this the old school way by looking at the power sensor during a wash cycle. You really only have to see how long it stays at the lowest threshold during the changeover from wash to rinse and from drain to spin.
I ended up making two template sensors to account for the washer and the dryer and then used those for my automations.
#
# Automation Templates
#
# True when washer power level is below 3.4 watts, high threshold of resting state
# Default state is true
washer_pwrdn:
value_template: "{{ states('sensor.aeotec_smart_switch_6_power_10_8') | int < 3.4 }}"
# True when Dryer power level is above 8.4 watts, showing dryer is in operation (as opposed to just having the door open)
# Default state is false
dryer_pwrup:
value_template: "{{ states('sensor.aeotec_smart_switch_6_power_11_8') | int > 8.4 }}"
It just wasn’t worth the trouble to do it other ways. I looked into Logentries and Jupyter notebooks and the like and the end it was just easier to keep an eye on the sensor and work off that.
Thanks rpitera! I was thinking about this as a next step, although this project is about automation and doing als little stuff as possible by hand In the meantime I’ve been tinkering with Thingspeak which looks like an ideal tool just for this purpose. But, setting it up hasn’t worked so far. I’m getting a generic error, looks like something in the code might be wrong, I don’t know. But in the meantime it looks like I’m going to have to do this manually.
I did find the other thread where you posted your entire solution, thanks for sharing! That’s really going to be helpful later on
Glad I could help. I know how much this has helped me and so I can understand your wanting to get it to work. Let me know if I can be of any other help.
It’s working! In the end I did end up using Logentries, the weekend was just too busy to do a proper measurement by hand. I just sent everything to Logentries, filtered on the specific sensor and imported the data as CSV in Excel. Got a nice graph, apparently the machine never stops for more than a couple of seconds so the end was quite clear. Thanks again for the help, above all I learned a lot from this adventure
Setting it up was the easy part: I created an account, took the token, put it in the conf.yaml like described on the components page and almost instantly the numbers were flowing on the screen. What is important though, is that there are tokens for both the account and the log set. You need the latter, could that be the problem?
From there it became a bit hackish. First you have to figure out a good search string which isn’t quite clear. After that site provides 3 ways to download the data (plaintext, json and html) but somehow it only returned plaintext for me no matter what I did. I put it in a text editor, trimmed out 90% of the data that was useless and imported it in excel as CSV.
First I was trying to get Thingspeak to work, but that didn’t work out for reasons that are still unclear to me. This has been about 40% of my Home Assistant experience so far. You think you have everything figured out, still doesn’t work. Last night with the Mosquitto instance installed through the all-in-one installer. Spend two hours fixing it, things only got worse. Deleted it, re-installed, works like a charm now I guess the key is not giving up!