Error: Action, Controller: could not convert string to float

Hi @KyleGabriel and @dookaloosy , thanks for all the effort to make this custom input module. It really helps.

I am using the same sensors but with the ADS1256 AD/DA converter. I am not the greatest coder but have made an input using your new input module and the ADS1256 input module’s code. It seems to be working fine for manual calibration but the automated calibration feature returns the error:

Action, Controller: could not convert string to float

Any advice on a possible fix would be great. I would attach my code but it won’t allow me as a new user. Thanks

1 Like

Hi. I split this into a new thread since it’s a new issue. For any issue related to code, we’ll need to see the code to be able to diagnose the issue. Please attach the entire module file. Also, what version of Mycodo and database version are you running? This can be found on the /info page.

Okay great.

Attached is the input module I attempted to mesh together. I am running Mycodo version 8.9.2 and the database version is 110d2d00e91d.

ads1256_analog_ph_ec.py (27.2 KB)

And how exactly would I replicate the issue?

With the uploaded input module, when attempting to press any of the “calibrate X, slot Y” buttons, the error occurs.

*for the actions section.

Upgrade to master and see if the issue persists.

Issue is still persisting. Attempted the upgrade twice to make sure and the logs say it was successful. The database version is now 4fedeb57e75b.

Your adc_calibration is included in the custom_actions list. It needs to be in the custom_options list. Only items relevant to the action should be in custom_actions. Since adc_calibration is an option that’s only used during activation of the Input, it’s an option. The reason for the error is that action options of type “select” are not yet supported (however, they should be, so I just added it in case someone has a use for it).

Thanks for all the help!

1 Like

You’re welcome. Please share the final version of your Input after testing and I’ll include it in the built-in set. Thanks.

1 Like

Any update on a final Input that can be incorporated into the next Release?

Hi Kyle, unfortunately, I have not had an opportunity yet to attempt to debug the code. The channel selection is faulty and only ‘channel 0’ and ‘channel 1’ work for pH and EC. In the meantime, I have attached the working code if anyone is able to solve the issue. I will try to get to it in the coming weeks.
analog_ph_ec_ads1256.py (27.3 KB)

1 Like

Give this one a try. This allows the pH and EC to be set to any of the 8 channels as well as allowing voltage to be measured from the other channels. Conversions should also work, but if you change the pH or EC channel, the conversion should be reset and you’ll have to set it again. Let me know if there are any issues. If everything works as expected, I’ll include it in the next release.

ads1256_analog_ph_ec.py (29.7 KB)

1 Like

Fantastic - I’ll test it out and let you know.

1 Like

Hi Kyle, the channels are interchangeable now and working (mild testing done) - thank you. However, when attempting to calibrate the pH and EC slots, this error is shown. My previous custom input is still calibrating correctly.

Here’s the module with the calibration fixed (hopefully). Since it has the same name, be sure to delete the Input, delete the imported Input, then import and add the Input again.

ads1256_analog_ph_ec.py (29.7 KB)

1 Like

Seems to be good now! Will look out for other bugs but I think it can be included in the next release now.

1 Like