Announcement

Collapse
No announcement yet.

Can not send device values with units kW and kWh to InfluxDB 2.x using mcsMQTT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can not send device values with units kW and kWh to InfluxDB 2.x using mcsMQTT

    Hi Stef,

    I have an issue with sending device values that have a unit kW or kWh to InfluxDB 2.x using mcsMQTT.

    Values for features such as instantaneous voltage, Instantaneous current, Tariff indicator electricity are correctly send to InfluxDB 2.x using mcsMQTT.

    I did some troubleshooting with Michael McSharry and my conclusion is that the issue is limited to the values that have a unit kW and kWh.

    Michael McSharry indicated that I need to determine why HS is not reporting via HSEvent that 1220 (actual electricity power consumed (in kW) has a Value that has changed. I think that you as plug-in author should be able to give more insight into that. And I hope that you are able and willing to solve this issue.

    ---
    John
    ​​​​​​​

    #2
    Hi John,

    I've been reading your message 3 times and still not sure I understand the issue. Are you saying events (including HSEvent) aren't being triggered on a value change, when the unit in the plugin settings is set to kW(h)?

    What happens if you set the units in the plugin setup to Watts? Does that resolve the issue?

    Without looking at the code, I remember not settting the "trigger on change" flag when I manually update the status field, to avoid triggering events twice. Maybe if the value doesn't change enough to change the status field it doesn't trigger at all? For instance, if the value changes from 1100 Watts to 1200 Watts, the kW value remains 1. Only until the value reaches 1500 Watts, it will trigger again. Is that what is happening?

    Again, if I understand the issue better I will have a look at the code to see how it works exactly and we will be able to figure out what/why/when and fix it!
    stefxx

    Comment


      #3
      Originally posted by stefxx View Post
      Hi John,

      I've been reading your message 3 times and still not sure I understand the issue. Are you saying events (including HSEvent) aren't being triggered on a value change, when the unit in the plugin settings is set to kW(h)?

      What happens if you set the units in the plugin setup to Watts? Does that resolve the issue?

      Without looking at the code, I remember not settting the "trigger on change" flag when I manually update the status field, to avoid triggering events twice. Maybe if the value doesn't change enough to change the status field it doesn't trigger at all? For instance, if the value changes from 1100 Watts to 1200 Watts, the kW value remains 1. Only until the value reaches 1500 Watts, it will trigger again. Is that what is happening?

      Again, if I understand the issue better I will have a look at the code to see how it works exactly and we will be able to figure out what/why/when and fix it!
      Hi Stef,

      In case I change the units in the plugin setup to Watts this will resolve the issue.

      Michael McSharry You indicated "indicated that I need to determine why HS is not reporting via HSEvent that 1220 (actual electricity power consumed (in kW) has a Value that has changed." can you elaborate on that so it is also clear for stefxx ?

      You wrote "Maybe if the value doesn't change enough to change the status field it doesn't trigger at all? For instance, if the value changes from 1100 Watts to 1200 Watts, the kW value remains 1. Only until the value reaches 1500 Watts, it will trigger again. Is that what is happening?"

      No that was not happening it was running overnight and also when the Daily max electricity produced changes (currently has a value of 2) no data was send to InfluxDB 2.x

      ---
      John

      Comment


        #4
        Ok, let me do some testing and get back to you.

        No help needed from Michael, I think I get it now.
        stefxx

        Comment


          #5
          Originally posted by stefxx View Post
          Ok, let me do some testing and get back to you.

          No help needed from Michael, I think I get it now.
          Thanks for looking into it.

          ----
          John

          Comment


            #6
            Can you test the latest beta to see if that solves the issue?

            Thanks!
            stefxx

            Comment


              #7
              Originally posted by stefxx View Post
              Can you test the latest beta to see if that solves the issue?

              Thanks!
              Hi Stef,

              This fixed the issue.

              ---
              John

              Comment


                #8
                Nothing has changed in any calculation. Only the event trigger logic.

                The device you show is a total device. Is 2816kWh really that strange?

                Note that the device value is ALWAYS is Watts. No matter how you've configured the plugin, whatever unit you select it is only being used in the STATUS. Again, the VALUE is always in Watts (or Watt Hours).
                stefxx

                Comment


                  #9
                  Originally posted by stefxx View Post
                  Can you test the latest beta to see if that solves the issue?

                  Thanks!
                  Hi Stef,

                  See the remaining issue. The units in HS and InfluxDB differs.

                  Click image for larger version

Name:	Capture 1.PNG
Views:	152
Size:	15.0 KB
ID:	1527067Click image for larger version

Name:	Capture 2.PNG
Views:	121
Size:	94.4 KB
ID:	1527068
                  ---
                  John

                  Comment


                    #10
                    Originally posted by stefxx View Post
                    Nothing has changed in any calculation. Only the event trigger logic.

                    The device you show is a total device. Is 2816kWh really that strange?

                    Note that the device value is ALWAYS is Watts. No matter how you've configured the plugin, whatever unit you select it is only being used in the STATUS. Again, the VALUE is always in Watts (or Watt Hours).
                    Sorry, I had a look at the wrong device.

                    If I understood correctly the issue reported (different units in HS and InfluxDB) can not be solved.

                    ---
                    John

                    Comment


                      #11
                      I don't see any issue here. Note that I have no knowledge about InfluxDB. But I see numbers that makes sense to me!
                      stefxx

                      Comment


                        #12
                        Originally posted by stefxx View Post
                        I don't see any issue here. Note that I have no knowledge about InfluxDB. But I see numbers that makes sense to me!
                        Hi Stef,

                        The numbers make sense. The only issue is that the status in HS is displayed in kW and in InfluxDB in W. However I can easy solve this issue by dividing the values by 1000 when I visualize.

                        Thanks a lot for the quick fix.

                        ---
                        John

                        Comment


                          #13
                          Please read my previous message. The VALUE is ALWAYS in Watts or Whatt Hours. Only the STATUS (device string) can be configured.

                          Glad it works for you now!
                          stefxx

                          Comment


                            #14
                            For me this is a stable release and can be released.

                            ---
                            John

                            Comment

                            Working...
                            X