Announcement

Collapse
No announcement yet.

MyEnergi API

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

  • Michael McSharry
    replied
    This is something I was concerned when I change from my internal JSON parsing code to Newtonsoft for the parsing. With the new code the array index is a two digit number while I believe it did not have leading zeros in the original.

    For example the current parsing will have the first eddi array set of data with "Sub: URL/s18.myenergi.net.GET:eddi:00: pri" while I believe the original may of had it as " Sub: URL/s18.myenergi.net.GET:eddi:0: pri". If I am correct on this then the second of these are no longer being updated and the update will be on new entries on the Association table with the two digit 00.

    If I am correct you can enter the ref number from any existing associations and put it in the Ref column textbox of the new one that has the two digit index. This should result in HS then being updated based upon the new parsing of the JSON data.

    At some time later after all seems to be back in order then obsolete the entries with the single digit index just to remove the clutter. This is most easily done on the General tab , Obsolete row text box with

    Code:
    URL/s18.myenergi.net.GET:yyyy:0:#
    where yyyy is the array object name such as eddi in this example. Be careful to not obsolete then ones with a two digit index. The obsolete operation can also be done on the Association tab using the Obsolete column checkbox in a more visual manner, but will require mode clicks.

    Leave a comment:


  • Mack1979
    replied
    Thanks. That's got it working again in the log with responses coming through, however, none of my devices are updating. They still appear linked correctly in the plugin so short of wiping them all and re-creating from the plugin again, is there anything else I can check as to why they're not getting values from the json string?

    Leave a comment:


  • Michael McSharry
    replied
    You should be good to go with 5.23.8.2 at mcsMQTT Change Log (HS4 & HS3) - HomeSeer Message Board

    I may do some optimization of the parsing in the future to better handle the JSON array, but this general case implementation should work fine.

    [edit] Optimization performed in 5.23.8.3 which is at same hyperlink as 5.23.8.2

    Leave a comment:


  • Mack1979
    replied
    Realised that's the GivEneregy issue. Also have a MyEnergi issue since updating, not showing in debug log, but in HS4 log:
    ProcessMessage New URL/s18.myenergi.net.GET={"eddi":[{"sno":******,"dat":"15-03-2022","tim":"07:40:41","ectp2":156,"ectp3":841,"ectt1":"Inte rnal Load","ectt2":"Grid","ectt3":"Generation","bsm":0,"bst":0,"c mt":254,"dst":1,"div":0,"frq":49.99,"fwv":"3200S3.048","gen" :841,"grd":152,"pri":1,"sta":1,"tz":0,"che":0.03,"hpri":1,"h no":1,"ht1":"Tank 1","ht2":"Tank 2","r1a":0,"r2a":0,"rbc":0,"rbt":1,"tp1":127,"tp2":127}]},{"zappi":[{"sno":------,"dat":"15-03-2022","tim":"07:40:41","ectp2":-3,"ectp3":2,"ectt1":"Internal Load","ectt2":"None","ectt3":"None","bsm":0,"bst":0,"cmt":25 4,"dst":1,"div":0,"frq":49.99,"fwv":"3560S3.147","gen":841," grd":152,"pha":1,"pri":2,"sta":1,"tz":0,"vol":2339,"bss":0," lck":16,"pst":"A","zmo":3,"pwm":5300,"zs":256,"rac":8,"rrac" :-4,"zsh":1,"ectp4":6,"ectt4":"None","ectt5":"None","ectt6":"N one","mgl":50,"sbh":17,"sbk":5}]},{"harvi":[]},{"asn":"s18.myenergi.net","fwv":"3401S3.077"} at Newtonsoft.Json.JsonTextReader.Read() at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings) at Newtonsoft.Json.Linq.JObject.Parse(String json) at MCSMQTTHS4_2020.ProcessMessage.GetJSONKeyList(String sValue) in C:\Users\Public\Documents\TFVC\HS\MQTT\MCSMQTTHS4_2020\Proce ssMessage.vb:line 507 at MCSMQTTHS4_2020.ProcessMessage..ctor(MqttMsgPublishEventArgs eventArg, Int32 iPubBroker) in C:\Users\Public\Documents\TFVC\HS\MQTT\MCSMQTTHS4_2020\Proce ssMessage.vb:line 281 Line 0 Additional text encountered after finished reading JSON content: ,. Path '', line 1, position 373.

    Leave a comment:


  • Mack1979
    replied
    Thanks. Version 5.23.81 has got it back working, but some elements are getting bad request responses. I can't work out from the log what is actually wrong:
    15/03/2022 07:41:08 307374 | ActOnMessageForTrigger QueueSize=0 ,Topic URL/www.givenergy.cloud/GivManage/api.POST,Payload {"total":1,"success":true,"rows":[{"nominalPower":0,"country":"UNITED_KINGDOM","timezone":0 ,"t imezoneText":"GMT 0","name":"xxxxxxxxxxxx","plantId":4204,"countryText":"Engla nd","createD ate":"2021-11-02"}]}
    15/03/2022 07:41:08 307390 | HTTP Post Response Error https://www.givenergy.cloud/GivManage/api Data= at System.Net.HttpWebRequest.GetResponse()
    at MCSMQTTHS4_2020.HttpURL.SubmitHttpPost(String sCommandIn, String dataIn, String sHeader, Int32 iAuth, String sToken) in C:\Users\Public\Documents\TFVC\HS\MQTT\MCSMQTTHS4_2020\Netwo rk.vb:line 562
    Line 0 The remote server returned an error: (400) Bad Request. 0 The remote server returned an error: (400) Bad Request.
    15/03/2022 07:41:08 307391 | HTTP Post Finally no Response

    Leave a comment:


  • Michael McSharry
    replied
    I tried to make the setting backward compatible but did not quite get it correct. Fixed in 5.23.7.2 which is available at bottom of first post at mcsMQTT Change Log (HS4 & HS3) - HomeSeer Message Board.

    To get back to where you were you will need to use a backup mcsMQTT.ini where the delimiter is semicolon. Alternately, manually edit the existing one so it is the same as the prior one that has semicolons, but change the semicolon to pipe and add two pipe characters at the end of each line. This alternate approach will not require updating the \bin\mcsMQTT files to 5.23.7.2. The mistake was only on the reformatting which is done only once.

    Unless HS devices are deleted they can be restored if necessary. Edit of data\mcsMQTT\mcsMQTT.db, MQTT_Receive table will set URL to HS Device relationships. It should also be able to be done from the Edit tab when starting with the URL/xxx as the Topic, but it has been a long time since I visited a Ref edit from the Edit page.

    Leave a comment:


  • AshaiRey
    replied
    Just upgraded to 5.23.5.0 and i have to report that the settings under [HTTP] in the ini file aren't loaded anymore.
    The settings for cloud access aren't set anymore

    To be more correct, the previous settings from an earlier version of MQTT aren't imported from the ini file and the settings are left blank.
    When filling in new settings then these are stored in the ini file correctly and used

    [edit] I think you changed the delimiters from ; to |
    is there a way to keep the original device associations when repairing this?

    Leave a comment:


  • Mack1979
    replied
    I've added a note on this to the step-by-step in post #17

    Leave a comment:


  • AshaiRey
    replied
    Originally posted by Michael McSharry View Post
    Did you see post #22 in this thread? It seems like the same thing you are asking. In essence you use the mcsMQTT Edit tab to define the text to number relationships after you selected Button of List as the Control/Status UI.
    Thanks for pointing me to post #22. That was what is was looking for.
    I just missed it. So many new things, configuration and settings to fiddle with and to learn.
    Thanks for your patience with me.

    Leave a comment:


  • Michael McSharry
    replied
    Suggest starting a new thread for solaredge integration as this one is for myEnergi. There are also updates to the plugin in this thread so it is important to know what version of the plugin you are using. The setup changes. The URL with a space (%20) also looks very odd. Is the space required? This will be a GET request without authorization. The text after ? will not be in the URL. It will be in the Endpoint if polling or in the text box on the Devices page. The ? will not be used.

    Leave a comment:


  • Guest
    Guest replied
    I think I have a related question but then for the Solaredge API to obtain online information about my solar panels. It took me some iterations to get the proper demands in a webbrowser as the online manual (https://www.solaredge.com/sites/defa...toring_api.pdf) was to me at least not always that clear.

    A command that work in my browser is:

    https://monitoringapi.solaredge.com/%20site/<<site-ID>>/overview.json?api_key=<<api-key>>

    Which returns the following JSON string:

    {"overview":{"lastUpdateTime":"2021-10-11 12:32:28","lifeTimeData":{"energy":5662980.0},"lastYearData" :{"energy":5605731.0},"lastMonthData":{"energy":129728.0},"l astDayData":{"energy":4489.0},"currentPower":{"power":1384.0 },"measuredBy":"INVERTER"}}

    I would like to transfer these data into variables in Homeseer that are regularly updated. I tried to follow the steps described above but there are no new associations created.
    - In the cloud part of this MQTT-plugin I entered: https://monitoringapi.solaredge.com
    - A floor URL is created and before the submit button I tried several input: ?, %20site/<<site-ID>>/overview.json?api_key=<<api-key>>, +site/<<site-ID>>/overview.json?api_key=<<api-key>>, site/<<site-ID>>/overview.json?api_key=<<api-key>> but with these input nothing is generated in associations.
    - Checked the log which mentions the following error: Error displaying device (1) URL monitoringapi.solaredge.com :Control:A status graphic with that value set already exists Check with the owner of the plugin that created this device.

    Anyone that can point me a bit in the right direction?

    Leave a comment:


  • Michael McSharry
    replied
    Did you see post #22 in this thread? It seems like the same thing you are asking. In essence you use the mcsMQTT Edit tab to define the text to number relationships after you selected Button of List as the Control/Status UI.

    Leave a comment:


  • AshaiRey
    replied
    Does anyone have an idea how to solve this
    The tag GET:zappi : pst result in a letter code A, B1, B2, C1, C2 or F.
    This is written as a string in the HS device. But I want a more readable description in the string such as EV Connected or Charging.
    I do not see any values so i can't use [ Edit Status Text for device Status ] to connect a value to the device string.
    Any thoughts on how to solve this?

    Leave a comment:


  • Michael McSharry
    replied
    I did include the update to keep the URL replacement text in place and only resolve to the endpoint at the time the access to the site is being made. It is at
    HS3: http://mcsSprinklers.com/MCSMQTT_52102.zip
    HS4: http://mcsSprinklers.com/MCSMQTTHS4_52102.zip

    I did not pursue any further the specific case of the Director site. The technique I'm using to access it does not provide visibility into a return header when 401 unauthorized response is received. I could try other techniques, but since there is no need I did not pursue alternatives.

    Leave a comment:


  • AshaiRey
    replied
    Some help on the director.myenergi.net calls

    See this post
    Update to "Active Server" redirects - myenergi

    New approach
    We are in the process of updating the server code so that all API calls will return the asn information in the headers of the HTML response.
    Every API call will include the header "x_myenergi-asn" with the correct target server, eg


    and further down.

    check the "asn" response in the headers. You may get a 401 - Unauthorised error when calling the Director, but the asn response will still be in the header.


    But i think this isn't a huge dealbreaker because this is how i understand it ounce you are moved to the S18 server you gonna stay there.
    No real need to make this URL as a variable that change all the time.
    But that is my oppinion.

    Leave a comment:

Working...
X