First time playing with home assistant, have managed to get most things running but am having my first hurdle.
So, I managed to get my Solax Inverter data via the Solax CLoud API as instructed here:
I made some tweaks to the code to get it working and I do get status and some data.
The issue I am having now is that I can’t seem to get it working right so that I am able to select the sensor for the energy solar generation data on the Energy Page.
Here is my configuration.yaml code (stripped of personal ID), I figure the code is a little old and may need adjusting to work for selecting as a sensor for Add Solar Production on the Energy settings page. Any guidance will be appreciated.
Based on the documentation, and several other posts, neither the new REST integration or RESTful Sensor integration support the state_class option when included in the sensor’s configuration.
What has been suggested (but I have not confirmed) is to add state_class to the sensor as a custom attribute (via either customize.yaml or Configuration > Customization).
Also with the code from my first post, I get tonnes of syntax errors when editing using Visual plugin. Something tells me that though it sort of works, its not the current way of doing things.
And just so I can confirm and not think I am going nuts… but I am very new at this, like first install a week ago.
So far all the documentation and examples of yaml code I find seem to be broken. Has there been a change recently that also affects the yaml formating?
That’s indicating precisely what I explained in my previous post. You can’t add state_class to the RESTful Sensor’s configuration. However, it’s needed if you want it to be visible to the Energy integration. The workaround is to add it as a custom attribute.
Tip
If the URL is the same for all of those RESTful Sensors then you might be better off defining them using the REST integration. You still can’t add state_class directly but the syntax is a bit more compact. That’s what tom_l referred to as the “new format”.
Because each sensor needs: device_class: energy state_class: total_increasing
The first can be added to each sensor’s configuration, the second one added as a custom attribute to each sensor (using one of the two methods described in my previous post). Maybe in the future the REST integration will support state_class in the configuration but, for now, you must add it as customization.
had a few more hiccups with getting customize.yaml working but finally have the sensors available in the energy tab.
Thank you very much for the guidance, but more importantly, for not giving me the straight-up answer. I still had to nut it out and therefore have learnt quite a bit in the process.
All of the errors in your configuration were clearly identified and instructions provided to correct them. Even links to the documentation were supplied.
What do you feel would have constituted a more ‘straight-up’ answer?
I was just pointing out that I was happy with that. Rather than just being given a code sample that works, I still had to read and learn and work out the code to use. Sometimes in various things, I just get told do this. No explanations, or anything, and therefore I don’t learn.
I am not being sarcastic or anything if you think that, I am being genuine. After this experience, I now know lots more about the YAML code than I did when I started. I will guarantee this won’t be my last hurdle, and knowing more will mean I should be able to solve more problems myself in future.
And, also, a big thankyou for your help, it was very much appreciated.