Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote buttons (door switches) #752

Closed
theyosh opened this issue Dec 1, 2022 Discussed in #751 · 10 comments
Closed

Remote buttons (door switches) #752

theyosh opened this issue Dec 1, 2022 Discussed in #751 · 10 comments

Comments

@theyosh
Copy link
Owner

theyosh commented Dec 1, 2022

Discussed in #751

Originally posted by EvilHomerGD November 27, 2022
@theyosh what are the chances of adding some additional remote (JSON) functionalities? A little background for you: I have multiple enclosures setup throughout my house (or is it a zoo?). I've been looking at ways to add those remote sensors and come up with a fairly simple solution. I have setup a Pi Pico W to spit out sensor information (temp and humidity) to a JSON page. I've been toying with a reed switch for the doors and would love to be able to read that state into my main TerrariumPi interface.

theyosh added a commit that referenced this issue Dec 2, 2022
theyosh added a commit that referenced this issue Dec 3, 2022
@EvilHomerGD
Copy link

EvilHomerGD commented Dec 4, 2022

maybe I'm missing something here but when I add the button, I get "Could not update remote button: int() argument must be a string, a bytes-like object or a number, not 'NoneType'". I have the button address set to "http://10.50.2.176/#door1/isOpen" to traverse the JSON to the value that will be 0 if the door is open and 1 if closed (I can easily swap my logic).

FYI, my JSON output looks like this:
{"door1": {"isOpen": 1}, "door2": {"isOpen": 0}, "probe1": {"valueT": 20.92508, "valueH": 45.18044}, "probe0": {"valueT": 20.79958, "valueH": 46.08987}}

@theyosh
Copy link
Owner Author

theyosh commented Dec 4, 2022

Hmm,

Not sure what has changed, but for me it works now. I made a logic error 5 years ago about door statuses, so I have to do some inverse logic juggling... ;) But with you JSON example it does work for me now.

Do a new git pull and it should work...

@theyosh
Copy link
Owner Author

theyosh commented Dec 4, 2022

And I expect a 0 for door closed in default mode. If you cannot change that, you can use the inverse toggle in the calibration section to change that.

A '0' is converted to closed / not pressed. Any number higher then 0 will be then open / pressed

@EvilHomerGD
Copy link

That seems to have fixed the error. I'll fix my logic to change the way the doors report their open/closed status. That's a simple if/else.

@EvilHomerGD
Copy link

So it would seem that when I did my git pull, it didn't pull down init.py which is what was giving me fits (I'm more well versed with subversion so it could be something I did). I manually pushed the updated files and can confirm that everything is working as expect. Now I just need to address my logic which is easy enough. Thanks for the quick turnaround and patience with me.

@theyosh
Copy link
Owner Author

theyosh commented Dec 8, 2022

Nice, that means this is now working and implemented. And can we close this issue?

@EvilHomerGD
Copy link

I would say it is safe to close. It is absolutely working wonderfully for me.

@theyosh
Copy link
Owner Author

theyosh commented Dec 9, 2022

Nice, and thanks for testing!

@theyosh theyosh closed this as completed Dec 9, 2022
@theyosh
Copy link
Owner Author

theyosh commented Dec 9, 2022

Oh, almost forgotten... Could post some pictures at: #210

@EvilHomerGD
Copy link

EvilHomerGD commented Dec 9, 2022

I absolutely will! I have to take some new pics since I've added 3 more enclosures since I last posted pics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants