nebulous / infinitude

Open control of Carrier/Bryant thermostats
MIT License
225 stars 50 forks source link

Controlling Carrier Infinity not happening #41

Closed mpcookson closed 5 years ago

mpcookson commented 7 years ago

New to infinitude, but very excited to have found it. Before I replaced my 20 year old HVAC system, I was running a python based thermostat program based on one of the various Raspberry Pi thermostats but heavily modified to make use of some additional Pi Zero's across the levels of the house and a list of WiFi MACs to arp for to know if it should be in "home" or "away" mode. The instant switch from home to away as I walked out the door is what I miss most (I sometimes work from home and like it if the thermostat can stay in home mode without me having to remember every morning).

Is this something that I can I do with infinitude? It seems like I should be able to, but after issuing a test "http://192.168.1.5:8080/api/1/hold?activity=sleep&until=15:15" with Safari I don't see any updates on the thermostat or the Infinitude Status page, though I do see it in the Comfort Profiles page. I wanted to see that work before I moved on to curl or perl.

Am I doing something wrong here? It looks like the thermostat is connected through the infinitude proxy connection and the Status page has updated several times while I've been writing this.

Thanks, Mark

mpcookson commented 7 years ago

Also, for what it's worth, it doesn't seem like infinitude is calling wunderground.com either as my developer API account registers no calls in the past two days. Infinitude is running, however, and appears to pick up changes that initiate from the MyCarrier app, but not from the thermostat, and doesn't seem to be able to affect the thermostat either.

I would really love to get this working, so any suggestions are welcome and if I can supply any debugging information, just let me know.

7ooL commented 7 years ago

i can set the status using 'http://192.168.1.248:3000/api/1/hold?activity=sleep&until=15:15' so your command should work assuming you have setup the port and ip correctly. My thermostat will show that the hold is on and will reflect the change. I am also able to pull this information from infinitude for display in my own GUI.

check that the globe is lit up on your infinitude web portal image this toggles on the communication pass through to carrier server i believe.

I have noticed that i can no longer control the thermostat via the iphone app now that i have infinitude running.

as for the wundergroud i know there were some configurations to set your key in a config file. have you done something like that?

mpcookson commented 7 years ago

Thanks for confirming that the command should work. I do have the blue globe as well. The 8080 port is the default for the Infinity thermostat, so I configured Infinitude to that rather than change the setting on the thermostat.

I've checked that iptables isn't blocking anything on the Pi. Both the Pi and the thermostat have static IPs (for what it's worth).

I've started infinitude like:

sudo /home/hvac/infinitude/infinitude daemon -m production -l http://*:8080

in a screen session to see if I get any debugging output. So far, nothing. Is there additional debugging that I can turn on?

I did put my wunderground key into the infinitude.json config file, but doing a double check I see that I screwed that up, so I've fixed it. I still don't see Wunderground showing that I've connected to it today (after restarting infinitude, but I don't know how often Infinitude checks the weather so I'll give that 24 hours.

However, I still can't get Infinitude to control the Infinity or for Carrier's website to see changes that are made in Infinitude, so they're not going up to Carrier or down to the Infinity.

I don't care much about the Carrier web app, I would be fine if I could control it from my Pi (since I could VPN back into the house and adjust it with Infinitude, or ideally with my own code). What version of Infinity code are you running? I'm running 131493-14.01.

Thanks!

mpcookson commented 7 years ago

I notice that if I do:

http://192.168.1.5:8080/api/1/hold?activity=sleep&until=23:00

I get:

Use of uninitialized value in string eq at /home/hvac/infinitude/infinitude line 128.

popping out of stdout and a lot of output in the browser window, but if I do:

http://192.168.1.5:8080/api/1/hold=on?activity=sleep&until=23:00

I only get:

{"status":"success","data":{"until":["23:00"],"activity":["sleep"]}}

in the browser window, so maybe my request was malformed. However, even though the response from Infinitude is looking better, the Infinity still isn't changing.

I'm out of ideas, but willing to try things if other people have ideas.

cribbstechnologies commented 7 years ago

@7ooL what firmware version are you running on your thermostat?

mpcookson commented 6 years ago

Sorry for the delay, I had given up, but I would like to try again so I've done a clean install on a Pi Zero and I still have the same issue...

The thermostat's software version is 131493-14.01. The wi-fi firmware version (if that matters) is 2.5.5,1.6.8. The model number is listed as SYSTXCCITC01-A.

Thanks!

mpcookson commented 6 years ago

I see on the Infinitude page that it updates when the thermostat tells the heater to turn on (zoneconditioning went from idle to active_heat and then back to idle), but still my set requests go into the bit bucket with the thermostat never seeing them. I just checked Carrier's website and they don't see the change either.

I would be happy if I could control everything through Infinitude and not Carrier's website.

Thanks, Mark

mpcookson commented 6 years ago

Weird, first attempt to set the mode worked and returned success. All subsequent attempts have returned a blue screen (in the browser) or a blue screen with a rainbow puking t-rex and this output in stdout on the pi:

[Sun Nov 19 12:21:03 2017] [error] not well-formed (invalid token) at line 2, column 23, byte 62 at /usr/lib/arm-linux-gnueabihf/perl5/5.24/XML/Parser.pm line 187. XML::Simple called at ./infinitude line 121.

I'll see if I can figure out what it doesn't like about the request by looking around lines 187 and 121...

nebulous commented 6 years ago
  1. Infinitude limits how often it chats with Carrier's servers. Each endpoint sets a timeout before which it will not connect to the Carrier servers again. By default it does not do so at all. Set your pass_reqs configuration parameter in the state/infinitude.json file to the number of seconds you would like to pause between hitting Carrier servers again. Be respectful of their servers and remember that zero means "never".

  2. Infinitude may have a bug (or bugs :) ) relating to its cache. As Phil Karlton said "There are only two hard problems in computer science. Cache invalidation, naming things, and off by one errors."

nebulous commented 6 years ago

regarding @mpcookson 's message about the parser error:

line 187 is my $xml = XML::Simple::Minded->new($store->get('systems.xml')); which parses the main systems.xml thermostat configuration file. It's entirely possible if this is a new installation that you don't yet have a systems.xml configuration file. The thermostat periodically transmits its configuration. If you have your thermostat set to proxy thru a correctly configured Infinitude, then the first time the stat sends systems.xml, it will be stored in state/systems.xml

mpcookson commented 6 years ago

Thanks for the details on pass_reqs, it was set at 0, so I've set it 900 (15 minutes). Is there a document other than the setup guide at github.com/nebulous/infinitude/wiki/Installing-Infinitude-on-Raspberry-PI-(Raspbian)? That's all that I have to go on, so maybe I've missed something obvious/stupid?

Thanks for your help nebulous!

mpcookson commented 6 years ago

There is a state/systems.xml file in there and the GUI display is showing reasonable values. I wait until the systems.xml file is created and then do a http://192.168.1.71:8080/api/1/hold=on?activity=sleep&until=23:00 and it comes back with success but I get:

Use of uninitialized value in join or string at ./infinitude line 385.

on stdout. If I wait 30 minutes I don't see any update on Carrier's website or at the thermostat, so even though it said "success" nothing seemed to change. If I then do:

http://192.168.1.71:8080/api/1/hold=on?activity=sleep&until=23:15

to see if it can change again, that's where I get:

[Mon Nov 20 10:41:42 2017] [error] not well-formed (invalid token) at line 2, column 23, byte 62 at /usr/lib/arm-linux-gnueabihf/perl5/5.24/XML/Parser.pm line 187. XML::Simple called at ./infinitude line 175.

[Mon Nov 20 10:41:42 2017] [error] not well-formed (invalid token) at line 2, column 23, byte 62 at /usr/lib/arm-linux-gnueabihf/perl5/5.24/XML/Parser.pm line 187. XML::Simple called at ./infinitude line 175.

and I get a pale blue screen in the browser.

nebulous commented 6 years ago

I'm guessing it was just a typo on your part when entering this report, but http://192.168.1.71:8080/api/1/hold=on?activity=sleep&until=23:00 isn't actually a valid infinitude endpoint.

/api/1/hold is the endpoint, which takes an optional parameter hold which defaults to on. So http://192.168.1.71:8080/api/1/hold?activity=sleep&until=23:00 should be valid as well as http://192.168.1.71:8080/api/1/hold?hold=off

Incidentally I was able to do a bit of work over the weekend and have an experimental branch called chi if you're interested in testing that.

nebulous commented 6 years ago

The chi branch has been merged. This is a fairly major overhaul of the storage engine used for Infinitude and how it shares data with Carrier's webservice as well. Hopefully it will help with this issue.