my sensors don’t show up in MQTT like that, only as entities. I used their config file so I assume it’s how you did your setup. Would love to see your setup. thanks.
The script I posted earlier can be used to send auto discovery messages to group the entities into a single device. If you set the retain to true you never have to run it again. Also see mod for 220v multipliers.
The yaml file they provided doesn’t have device info. Attached is my yaml file you can modify to use.
mqtt.yaml
There are a few assumptions:
- No power generation (solar etc.). I combined energy in and out values and the direction you put the CT clamp on doesn’t matter anymore (making it easier to install).
- Breakers 1-4 are assumed to be double pole ones. You need to adjust to fit your situations. (Changing 2 to 1 in the multipliers for single pole except for current).
- Replace YOURSNINCAPS with the SN of your SEM-Meter.
- The icons I use are different from what they put in the sample yaml file. These are the standard ones for energy, power, voltage and current.
Let me know if you have any questions.
Installation took less then 30 minutes. Noticed I needed a firmware upgrade to speed up MQTT. Emailed support and the firmware was pushed that evening. I’ve now blocked internet access to the device and everything is pushing into HA with no issues. Dev seems very interested in working with the community. I really hope more people give this device a chance over some of the more expensive options!
I used @peterxian script (thanks!) to pull in my entities. Now to dive into designing a new energy dashboard by combing through all the examples.
Amazon has them in-stock again. I purchased a second on Friday for a second subpanel and it’s already shipped.
thanks @peterxian and @king1999
To those of you who are using local MQTT setup, I have a question. Currently I am using the remote MQTT server provided by the vendor. Does the app still work if I move to the local MQTT? I like to use the real-time graph on the app to do some detection work.
Yes. There are two separate MQTT servers/brokers in use here:
- The private/vendor MQTT broker that the device pushes its data to. This is being used to collect data that the app uses to display historical data. This data gets pushed infrequently (every few minutes? not sure exactly), unless you have the app open. When you launch the app, this pushes a message to the MQTT topic that the device recognizes that tell it to push data more frequently when the app is open. This happens for I believe 2 minutes until it goes back to infrequent again unless the app is still open.
- The HA MQTT broker that you can optionally setup. You can choose to either have your own local broker, or use the vendor’s broker (not the same address/servers as the one above). As previously discussed here, this data publishes every 30 seconds, unless you have the newer firmware which lowers this to 2 seconds.
Hope this helps.
Thanks for the info. Didn’t know that they use two MQTT servers. Looks like I can move HA to local MQTT server and can still use the app.
@peterxian how can I make the results of the script permanent? I tried changing the retain variable to true but the entities disappear.
thanks to all for the code and tips.
I do have one question - I would like my energy count in KWh to reset at midnight daily so it only shows the day’s energy consumption. currently the energy consumption seems to be ever increasing with no reset.
Is there a way to achieve this?
@troyboy27 If retain is true then entities should automatically appear after restart. It might wait until a mqtt message is actually received on the state topic. I haven’t tried it yet however, I just run the script in an automation that triggers on HA startup.
@clumsyninja2 To make a kWh counter that resets every day at midnight, you can create a Utility Meter Helper in the GUI under Devices & Services.
@peterxian Thanks! There was a delay after I restarted. All good now! Thanks for the reply.
Can anyone point me in the direction of documentation on how to setup the multipliers?
Post 44 above has an example for setting power_mult
for channels 14,15,16 to double the multiplier. Note you need to replace muliply(number) with multiply(power_mult)
in the payload calculation.
Caught that- just need some basic information to understand what role the multiplier plays. Still new to smart homes and especially energy monitoring.
Oh sure, the multiplier is for US split-phase households where both 110v hot lines are used to get a 220v circuit. You don’t have to measure both, you can just measure one and double the voltage and power (but not the current).
In the US, the multiplier 2 is for double pole breakers when you only measure one leg. Typical use for 240V appliances such as AC, Dryer, Oven and CookTop.
Is there a way to combine entities? For example I have 1 measurement on each leg, but it’s displaying as Solar 1 and Solar 2. I’d just like to combine it into one entity if possible.
I love this! I also added “| round(2)” after the “| multiply (X.X)” values to limit the occasional crazy long decimal values displaying in HA.
That’s what this for: suggested_display_precision: 2
Yes, just create an entity with a value template similar to this:
[ Suspicious Content] value_template: “{{ value_json.sense[16][3] | float | multiply(0.001) + value_json.sense[17][3] | float | multiply(0.001) + value_json.sense[16][4] | float | multiply(0.001) + value_json.sense[17][4] | float | multiply(0.001) }}”
You can add the values of many CT sensors together.