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

Idea to add new generic device to source data from an API? #86

Open
pentafive opened this issue Dec 13, 2024 · 1 comment
Open

Idea to add new generic device to source data from an API? #86

pentafive opened this issue Dec 13, 2024 · 1 comment

Comments

@pentafive
Copy link

I've got PSI for the DE filter coming using an ADC and that works VERY well. I'd like to get temp going but don't want to wire more sensors.

That's because I've already got a pool and air temp sensor and it can be accessed via an API. My idea is to add a new "generic device" that could pull the value of the temp sensor via API. Then it feed into the pool controller.

Here's an example of getting the value of my sensor using curl:

`curl -X GET \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    http://your-home-assistant-ip:8123/api/states/sensor.pool_float_sensor_temperature`

Here's an example response from my sensor:

{
    "entity_id": "sensor.pool_float_sensor_temperature",
    "state": "48.25",
    "attributes": {
      "state_class": "measurement",
      "unit_of_measurement": "°F",
      "device_class": "temperature",
      "friendly_name": "Pool Float Sensor Temperature"
    },
    "last_changed": "2024-12-12T21:13:46.722637+00:00",
    "last_reported": "2024-12-12T21:13:46.722637+00:00",
    "last_updated": "2024-12-12T21:13:46.722637+00:00",
    "context": {
      "id": "01JEYBGYF2C0DC4QX8C9RBSHSE",
      "parent_id": null,
      "user_id": null
    }
  }

At the minimum, there would need to be some config on placing the request and then which response is the value to use. Could get fancy and use other things like last_updated to track it etc.

Thoughts?

@tagyoureit
Copy link
Collaborator

We support reading from the ADC directly. You're easiest path would be to have REM read all the ADC values and then pass them off to HA or njsPC.

image

I don't foresee adding any outside polling capabilities to REM. Some of the devices already allow information to be pushed from outsides sources, but we don't pull it.

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