Hey Experts, I’m new to HA, having played with it for about an elapsed whole day…almost… Anyway, I have added HACS and added some rough and ready integrations for Daikin Aircons, Sonoff Devices, and LocalTuya and got them all to work. My formal training is in electronics as a tradesman and I have done programing all my life from back when basic was pretty much all there was. (Background so you can judge how little I know about HA)
I purchased from ebay, at not many AUD$ 3 of the Tuya devices that are dual channel power meters with 80A current transformers. (Tuya Smart WiFi Switch With Energy Meter Monitor Power Consumption Easily 80A | eBay) I noticed after discovering a flaw that some of these devices are advertised as being bidirectional and some (such as the ones I brought did not include that in the description but no matter teh description they all look the same…but it seems that there are multiple manufacturers all using same.similar form factor enclosures etc) So, before being aware of the issue I popped one CT on the main line into the switchboard from the utility and another on my solar inverter output which was more towards my house than the first meaning the first also included solar output that was unconsumed at the house…if any). At this stage I thought the device was bidirectional. I quickly identified that current flow was not signed, its always positive whether pulling from the grid (as Id expect) or when feeding back into the grid from the solar unconsumed at home (As I didn’t expect, I though it would be a negative flow in this case).
Anyway the 2nd CT is Ok being unidirectional as the inverter only ever sends current out, I moved the 1st CT to be on the house side of the inverter feedin because at that point the house only ever consumes from somewhere never feeding back and it can also therefore be unidirectional (No Battery in my setup yet)
However the setup for the energy dashboard doesn’t cope with such a setup, it expects a sensor feed from the inverter and the mains as I originally had it setup (I think) .
I believe programmatically I could create a template sensor (?) that mathematically subtracts inverter output from home consumption to arrive at grid consumption (which could be negative if feeding back into the grid) but I cant find any examples of that being done online, nor would I know exactly where to do that (Im unsure where any of the math is performed for the energy dashboards). Would Node Red be a suitable place to do the conversion? Ive already got some flows in place controlling sonoff switches etc which as someone who hasn’t really needed to do anything before with YAML or JSON or anything much via a webapi such as the Tuya Developers website is causing some head pain… any guidance you can provide would be gratefully received.
Regards
Andy