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

Wago automation controller support + additional 'concentration' sensor #10274

Closed
wants to merge 2 commits into from

Conversation

amigne
Copy link
Contributor

@amigne amigne commented May 29, 2019

Support for Wago automation controller, with addition of a new 'concentration' sensor type.

Wago manufactures programmable programmable automation controllers that can be used to retrieve data from misc sensors, such as temperature, humidity, CO2 concentration, contacts, ...

This PR adds support for such Wago PFC controllers and includes a new 'concentration' sensor type for gaz/particles concentration (expressed in "ppm" unit).

The Wago PFC returns raw data in an array without any meta-information describing the type of measured value or description of the origin of the data. This has to be manually set in the config.php. This is not very clean, but this is the only solution that permits to add some meaning to the collected SNMP values.

The code in this PR is working, but it is still considered as in progress. The following has to be done before being approved and merged:

  • Add some meaning for 'state' type values;
  • Fix the Health / Overview page for displaying 'State' graphs;
  • Fix the Health / Overview page for displaying 'Concentration' graphs;
  • Add display of 'Concentration' sensors on the device Overview page;
  • Add test data for this new OS;
  • Create a documentation for the $config['os']['wago']['plc'][] settings.

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926
After you are done testing, you can remove the changes with ./scripts/github-remove. If there are schema changes, you can ask on discord how to revert.

@murrant
Copy link
Member

murrant commented May 30, 2019

@amigne I know it might be more than you want to tackle. But maybe LibreNMS needs a way to have sensors of "unknown" type which are later assigned a type by the user in the webui... I know of a few more devices that have external sensors that do not report the type of sensor connected via snmp.

@amigne
Copy link
Contributor Author

amigne commented May 30, 2019

@amigne I know it might be more than you want to tackle. But maybe LibreNMS needs a way to have sensors of "unknown" type which are later assigned a type by the user in the webui... I know of a few more devices that have external sensors that do not report the type of sensor connected via snmp.

@murrant This sounds to be an easier way to fix this issue (missing of sensor type from the device) from the user point of view than playing with the configuration file. But I see a point anyway: having only the webgui as a way to set sensor types would be quite a nightmare if the user has about 50 devices with 10-15 sensors each (this is my case!). It would then need to manually edit the settings for 500-750 sensors through the webgui, which is not very convenient. If devices and sensors deployment is done with some reasonable thinking, it may be much easier to define a generic setting using the configuration file and to handle exceptions either with configuration file (using regexp), or with the webgui.

As I'm currently writing this module for my business, I propose to continue my current development based on the configuration file only... Once it is finished (and after my summer holidays are over ;-) ), I can start working on the webgui to manually define the sensor type for these devices.

@murrant
Copy link
Member

murrant commented May 30, 2019

Sure, but I don't think the config setting is going to be useful for most people. What happens when you have a single device in a different configuration?

An option would be to have a button that says apply these sensor types to other devices (when clicked it shows a selectable list with all devices of the same OS)

@amigne
Copy link
Contributor Author

amigne commented May 31, 2019

An option would be to have a button that says apply these sensor types to other devices (when clicked it shows a selectable list with all devices of the same OS)

Good idea : This is noted down for the upcoming webgui dev.

@amigne amigne force-pushed the wago branch 2 times, most recently from e410849 to cccffd8 Compare June 2, 2019 07:12
@amigne amigne changed the title [WIP] Wago automation controller support + additional 'concentration' sensor Wago automation controller support + additional 'concentration' sensor Jun 2, 2019
@amigne amigne changed the title Wago automation controller support + additional 'concentration' sensor WIP - Wago automation controller support + additional 'concentration' sensor Jun 2, 2019
@amigne
Copy link
Contributor Author

amigne commented Jun 2, 2019

An issue still needs to be fixed : the discovery script creates new records in the 'sensors' DB table.

@amigne
Copy link
Contributor Author

amigne commented Jun 2, 2019

Issue fixed and successfully tested.

@amigne amigne changed the title WIP - Wago automation controller support + additional 'concentration' sensor Wago automation controller support + additional 'concentration' sensor Jun 2, 2019
@@ -715,6 +715,93 @@ $config['ipmi']['type'][] = "open";

[Distributed Poller](../Extensions/Distributed-Poller.md)

### Wago data collection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be under doc/Support/Device-Notes/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I still wouldn't mind a general approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well Tony, I'll move the doc at the right place. Thank you for the feedback.

Regarding the general approach, this is in my TODO list, but this needs more thinking to design a really generic form that could be used for this Wago device, as well as any new device. I'll start working on it as soon as I'll be back from holidays. 🌞

@Jellyfrog Jellyfrog added Device 🖥️ New or added device support User-Pending Currently waiting for user response labels Dec 9, 2019
@Jellyfrog
Copy link
Member

Closing due to inactivity. Feel free to reopen!

@Jellyfrog Jellyfrog closed this Dec 9, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Device 🖥️ New or added device support User-Pending Currently waiting for user response
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants