Exactly, that occurred to me afterwards.
Strangely, the 200 status code is returned but Gladys returns an error (so no variable to reuse).
Ok, actually using braces outside of variables causes the error. Iâm updating the GitHub issue.
@lmilcent Actually the error comes from the fact that arrays in the responses were not being handled correctly, the parsing function only handled objects.
Iâve made a PR that fixes the issue:
Do you have a DEV environment to test?
In the meantime, you can use the Math.js API with a simple string instead of an array, and it works well ![]()
What I observed during my tests:
It works like that for me ![]()
Ah yes, there was another bug actually: attributes that are returned as « null » were crashing the variable generation
So we have to wait for the fix.
Ok, I was talking more about a dev environment (like on your laptop, so you can test PRs)
Well, never mind, Iâll test extensively myself with the Math.js API and it will go into the next Gladys release (not the one youâll see today)
I had started to set one up, but the issue was with the Zigbee service. Without an adapter, I couldnât use it with the data from my database (to run tests on real data).
Would there be a trick to simulate an adapter, not run Zigbee2MQTT but still be able to
It depends on what you want to test â indeed, to test PRs (pull requests) related to Zigbee2mqtt, that wonât be easy. But to test things related to the core, you donât need services. I often use a local MQTT service to test: I send values to a local mosquitto (I use https://mqttx.app/), I make myself a small dashboard, and thatâs enough to test most core developments!
If you ever want to test with your DB (database), so it doesnât impact your prod (production), you need to disable everything related to Gladys Plus so it doesnât connect in place of your prod.
In general, what I do when I want to load a userâs DB is: before starting Gladys, I empty the table t_variable which stores all the credentials for all the services, and that way Iâm sure that launching a test instance wonât contact the userâs real services (calendars, Gladys Plus, etcâŠ).
Thanks for the info! I wouldnât have thought of that.
Z2m supports TCP via ser2net, Iâll look into it soon. I donât know if @spenceur has tested it.
This makes the dongle available over the network.
Thatâs promising!
Hello @VonOx, would this z2m solution via ser2net to make the dongle available over the network be compatible with WSL? Because WSL doesnât recognize USB portsâŠ
Another question: can a sensor be paired with multiple z2m dongles (e.g., Sonoff)?
As mentioned above, I havenât tested it yet, but I think so.
Zigbee devices are paired to a dongle. Itâs exclusive.
Another solution weâve often discussed is being able to connect to a remote MQTT from the Z2M integration; that would allow connecting to a Z2M on a remote Pi and seeing how it behaves on a dev version of Gladys.
@lmilcent For your information I made progress on this today regarding your bug with the HTTP request to Mathjs, it wasnât simple because I had to change the format used by the front-end for variables to handle arrays, while remaining compatible with the existing setup and the different « consumers » of these variables: the âč message âș block and the âč continue only if âș block.
Iâve pushed the latest version to my PR, Iâll pick it up again on Monday (Itâs 7pm here :
Thank you and have a great weekend, enjoy!
FYI, I merged the PR that fixes the bug with the Math.js API; it will be part of the next Gladys release!
Great, thanks ![]()
I will be able to create a scene that uses a kind of averaging calculation, while waiting for Gladys to support it.
Use case
Alert me if my fridge warms up:
Retrieve the value from my fridge sensor every 30 minutes for 2 hours and alert me if the average of those values is above a threshold.
(in summer only) Alert me when I air my apartment, but it starts to warm up:
If the average of the temperatures in my living room and dining room is close to, equal to, or greater than the outside temperature, remind me to close the windows.
Tested and approved (https://gladys-new-device-name.netlify.app/)!

No need for a development environment on the userâs side!