Page 6 of 7

Re: Feature Requests

PostPosted: Thu Feb 20, 2020 6:38 am
by Umtauscher
P.S. There is nothing in the Indigo Event log at that time.

Re: Feature Requests

PostPosted: Thu Feb 20, 2020 6:56 am
by DaveL17
Thanks for that output. That's helpful as well.

Umtauscher wrote:
P.S. There is nothing in the Indigo Event log at that time.

What logging level do you have set in the plugin configuration dialog? When I test timeouts, I get warning-level messages written to the Indigo log:
Code: Select all
   GhostXML Warning                [GhostXML - Test JSON (O'Hare Online) - Real] curl error * Could not resolve host: soa.smext.faa.gov * Closing connection 0 . [Return code: 6
   GhostXML Warning                There was a parse error. Will continue to poll.

Re: Feature Requests

PostPosted: Thu Feb 20, 2020 7:02 am
by Umtauscher
I have set "error messages"

Here is the debug log
Code: Select all
   GhostXML Debug                  ReturnCode: 0
   GhostXML Debug                  Timeout for Curl Subprocess. Killed by timer.
   GhostXML Debug                  HTTPS CURL result: * Adding handle: conn: 0x7febb1802000
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7febb1802000) send_pipe: 1, recv_pipe: 0
* About to connect() to wx030-4.voyager95.de port 80 (#0)
*   Trying 192.168.1.214...

   GhostXML Debug                  ReturnCode: -9
   GhostXML Warning                [wx030-4] curl error * Adding handle: conn: 0x7febb1802000 * Adding handle: send: 0 * Adding handle: recv: 0 * Curl_addHandleToPipeline: length: 1 * - Conn 0 (0x7febb1802000) send_pipe: 1, recv_pipe: 0 * About to connect() to wx030-4.voyager95.de port 80 (#0) *   Trying 192.168.1.214... . [Return code: -9
   GhostXML Debug                  [wx030-4] Parse Error: No JSON object could be decoded
   GhostXML Debug                  [wx030-4] jsonRawData {u'max_volume_dot_ui': u'60', u'deviceLastUpdated': u'02/20/2020 at 13:58', u'distribution_enable': u'True', u'deviceLastUpdated_dot_ui': u'02/20/2020 at 13:43', u'mute': u'False', u'disable_flags': u'0', u'response_code_dot_ui': u'0', u'volume_dot_ui': u'21', u'link_audio_quality_dot_ui': u'uncompressed', u'distribution_enable_dot_ui': u'True', u'sleep': u'0', u'deviceTimestamp': 1582203493.29017, u'parse_error': True, u'link_audio_quality': u'uncompressed', u'equalizer_low_dot_ui': u'0', u'mute_dot_ui': u'False', u'equalizer_mid': u'-2', u'equalizer_high_dot_ui': u'9', u'equalizer_low': u'0', u'equalizer_mode': u'manual', u'input': u'net_radio', u'power_dot_ui': u'standby', u'power': u'standby', u'equalizer_mid_dot_ui': u'-2', u'volume': u'21', u'equalizer_high': u'9', u'deviceIsOnline': True, u'link_control': u'standard', u'link_control_dot_ui': u'standard', u'max_volume': u'60', u'input_dot_ui': u'net_radio', u'response_code': u'0', u'disable_flags_dot_ui': u'0', u'deviceTimestamp_dot_ui': u'1582202637.21', u'equalizer_mode_dot_ui': u'manual', u'deviceIsOnline_dot_ui': u'Processing', u'sleep_dot_ui': u'0'}
   GhostXML Warning                There was a parse error. Will continue to poll.
   SQL Logger                      adding column "devicelastupdated_dot_ui_ui_ui_ui" to table device_history_898683237 ("wx030-4")
   SQL Logger                      adding column "devicetimestamp_dot_ui_ui_ui_ui" to table device_history_898683237 ("wx030-4")
   GhostXML                        wx030-1
   GhostXML Debug                  HTTPS CURL result: * Adding handle: conn: 0x7ffbec00aa00
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7ffbec00aa00) send_pipe: 1, recv_pipe: 0
* About to connect() to wx030-1.voyager95.de port 80 (#0)
*   Trying 192.168.1.211...
* Connected to wx030-1.voyager95.de (192.168.1.211) port 80 (#0)
* Server auth using Digest with user ''
> GET /YamahaExtendedControl/v1/main/getStatus HTTP/1.1
> User-Agent: curl/7.30.0
> Host: wx030-1.voyager95.de
> Accept: */*
>
< HTTP/1.1 200 OK
* Server Network_Module/1.0 (WX-030) is not blacklisted
< Server: Network_Module/1.0 (WX-030)
< Content-Type: application/json
< Content-Length: 269
<
{ [data not shown]
* Connection #0 to host wx030-1.voyager95.de left intact

Re: Feature Requests

PostPosted: Thu Feb 20, 2020 9:03 am
by DaveL17
Hi Wilhelm - when you have a chance, please try the latest build from GitHub which hopefully addresses the cascading state name issue.

The version number is v0.4.50.

Re: Feature Requests

PostPosted: Thu Feb 20, 2020 12:14 pm
by Umtauscher
Hi Dave,

thanks, that was really quick, after all.
It seems to work without problems now. I have tested several times.
Super!
Thank you very much.
Cheers

Wilhelm

Re: Feature Requests

PostPosted: Thu Feb 20, 2020 12:18 pm
by DaveL17
Outstanding. Thanks Wilhelm. I'll push a formal release.

Cheers.

Re: Feature Requests

PostPosted: Sun Oct 04, 2020 10:26 am
by DVDDave
Dave,

Thanks so much for this great plugin. I was able to use it perfectly to access the data from my new Ambient Weather WS-2902c weather station and mostly access the data from my Nest thermostat with the new Google Nest api.

I'd like to request a feature that would allow me to completely access my Nest devices. Could you enable variable substitution for the raw curl authentication in the same way it's done for the URL?

Background: The Nest api utilizes an access token which must be renewed every hour. I have a python script running that does that and stores the token in a variable. However, I see no way to utilize that variable in the curl that provides the authenitication headers. I tried embedding the authentication in the URL but could not find a way to make that work.

Thanks again!

--Dave

Re: Feature Requests

PostPosted: Sun Oct 04, 2020 12:27 pm
by DaveL17
Hi Dave -- I should be able to do that no problem.

Fair warning--I'm in the midst of a fresh wipe/install on my main Indigo server machine and need to contend with that first (so my lights will come on when it gets dark out.)

Re: Feature Requests

PostPosted: Sun Oct 04, 2020 12:31 pm
by DVDDave
Fantastic! Certainly not urgent. Good luck with your server; I don't know how I would cope with actually getting up and controlling my devices by hand. :wink:

Re: Feature Requests

PostPosted: Fri Oct 09, 2020 5:29 am
by DaveL17
Could you enable variable substitution for the raw curl authentication in the same way it's done for the URL?

I believe that I've got this sorted and you can check out the attempt at: v0.5.02. At the outset, the curl substitution fields are hidden and will be displayed only after the Raw Curl option is selected. I'm not super happy with the UI implementation, but I think it's serviceable.

IMPORTANT: this is not an official release and includes other revisions that may contain bugs. It's best to back up your latest working version of the plugin before installing this one.

Please let me know how you get on.

Screen Shot 2020-10-09 at 6.28.13 AM.png
Screen Shot 2020-10-09 at 6.28.13 AM.png (77.14 KiB) Viewed 6969 times

Re: Feature Requests

PostPosted: Fri Oct 09, 2020 11:58 am
by DVDDave
DaveL17 wrote:
Could you enable variable substitution for the raw curl authentication in the same way it's done for the URL?

I believe that I've got this sorted and you can check out the attempt at: v0.5.02. At the outset, the curl substitution fields are hidden and will be displayed only after the Raw Curl option is selected. I'm not super happy with the UI implementation, but I think it's serviceable.

IMPORTANT: this is not an official release and includes other revisions that may contain bugs. It's best to back up your latest working version of the plugin before installing this one.

Please let me know how you get on.

Excellent! Seems to work great. Thanks, Dave.

Re: Feature Requests

PostPosted: Fri Oct 09, 2020 7:52 pm
by DaveL17
DVDDave wrote:
Excellent! Seems to work great. Thanks, Dave.

Terrific. Thanks for letting me know.

Cheers.

Re: Feature Requests

PostPosted: Sat Oct 10, 2020 1:41 am
by mclass
Hi Dave,

Thanks for the addition of the "raw CURL" feature. I have been using Ghost for some time in tracking other energy related data, notably output of my solar pv systems.

I'm not sure if this is the right place to raise this issue, but I am now trying using it to track energy prices from Amber Electricity here in Victoria. The plugin woks great, but it appears that the JSON data exceeds the capacity of the SQL Logger. The event log returns:

Code: Select all
SQL Logger                      adding column "data_variablepricesandrenewables_25_periodsource_ui" to table device_history_880552045 ("Amber Electric")
   SQL Logger Error                exception trying to update table device_history_880552045 ("Amber Electric") -- unable to modify table
   SQL Logger Error                too many columns on sqlite_altertab_device_history_880552045
   SQL Logger Error                exception trying to insert row into table device_history_880552045 ("Amber Electric") -- unable to modify table


As I the data I need is contained within the first 60 or so of the JSON records. is there a CURL command I could add to the device configuration (screenshot attached) that would truncate the download? If not, my option may be to just turn off SQL logging :roll:

Re: Feature Requests

PostPosted: Sat Oct 10, 2020 4:44 am
by DaveL17
Hi mclass - Unfortunately, I don't know of a universal way to ask for a subset of JSON (or XML) data. Many of the APIs that I work with have parameters for such things when sending the initial call. I suspect you've probably looked at the API docs and found that there's no such thing here.

This issue has come up before (hence the disable SQL logging feature). One thing you could try is to disable SQL logging for the device, copy your specific data to Indigo variables, and then add the variables to the SQL database (trigger on device state value changes). This should work fine as long as the API is stable and the fields you're interested in have stable names.

Re: Feature Requests

PostPosted: Sun Oct 11, 2020 2:23 pm
by mclass
Thanks for your prompt reply Dave.
Just for completeness, I have used my (very limited!!) Python skills to write a script that will retrieve the JSON records and just parse for the data I want. If nothing else, it has been an “interesting technical exercise”!!!

mclass


Sent from my iPad using Tapatalk