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

Adding multiple sensors of one type to senseBox:home #403

Open
mariopesch opened this issue Mar 8, 2021 · 3 comments
Open

Adding multiple sensors of one type to senseBox:home #403

mariopesch opened this issue Mar 8, 2021 · 3 comments
Assignees
Labels

Comments

@mariopesch
Copy link
Member

Don't know if its directly related to the frontend, api or the node-sketch-templater

Expected Behavior

If a user want to add a second Temperature and Humidity Sensor of the same type there should either be a warning, that it is not possible or the box should be converted to a custom box, so that the no wrong code won't gets generated.

Actual Behavior

If you add a second Temperature and Humidity Sensor (same HDC1080 as the first one) to the senseBox:home the Sketch doesn't compile anymore as TEMPERSENSOR gets defined multiple times.

// Sensor SENSOR_IDs
// Temperatur
const char TEMPERSENSOR_ID[] PROGMEM = "5dea9e381dd36c001945f1a2";
// rel. Luftfeuchte
const char RELLUFSENSOR_ID[] PROGMEM = "5dea9e381dd36c001945f1a1";
// Luftdruck
const char LUFTDRSENSOR_ID[] PROGMEM = "5dea9e381dd36c001945f1a0";
// Temperatur draußen
const char TEMPERSENSOR_ID[] PROGMEM = "60463aebf7b313001b52b56e";
@mariopesch mariopesch changed the title Adding multiple Sensors of one Type to senseBox:home Adding multiple sensors of one type to senseBox:home Mar 8, 2021
@ubergesundheit
Copy link
Member

I don't see any reasons not to support multiple sensors of the same type. So this should be fixed in node-sketch-templater. It should be possible to change he <TYPE>SENSOR_ID to include an index

@mpfeil
Copy link
Member

mpfeil commented Mar 23, 2022

We tackled this in PR sensebox/node-sketch-templater#86 on the node-sketch-templater.

The PR just fixes the following scenario: Connecting two different sensor types measuring the same phenomenon.
The variables are build like this: SENSORTYPE_SENSORNAMESENSOR_ID.

@mariopesch for the senseBox:home sketches it is not possible to register a device with multiple sensors of the same type or am I missing something here? At least through the registration process in the frontend it is not possible.

@mpfeil mpfeil self-assigned this Mar 23, 2022
@mariopesch
Copy link
Member Author

Yes through the normal registration process its not possible, but if you manually add a second temperature and humidity sensor of the same type as the first one the sketch templater still generates a code, but a faulty one.

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

No branches or pull requests

3 participants