That’s a good one too, but doesn’t the {{ [formatted result] / 60 }} calculation need a round to zero digits function?
like {{ round( [formatted result] / 60 ) }}
By the way, apart from your calculation, in case of sun events however, it’s not needed: the sun event time is available as local tag:
Your first and second BLL card require a date value as input (so the numerical representation of the date/time stamp in milliseconds). I assume the Zonnenstanden-app provides this tag accordingly. I don’t think it will work if you feed it with a text based formatted time (so formatted as HH:mm, which was the case in the Tesla question)
What I find interesting is that the third (Logic) card apparently allows you to divide a text based value (Formatted result, in green) by 60. Normally you can only calculate with actual numbers (tags are blue). The same goes for the addition calculation. Maybe Homey converts the tag to a numeric value, as it only contains numbers, but this is something to consider.
Hi Arie,
unfortunately some bll functions will occasionally not work. Reboot of the app will fix it until next occurrence. Sadly this will control my floor heating
Just FYI: when you use {{ and }}, the text and tokens are just directly parsed into the textfield (not only logic cards, but any flowcard using a textfield).
So, if the token/tag contains a number within a text-token, it is still inserted without quotes or anything, thus, in javascript, it is considered a number and can be directly used for calculations.
Thanks Arie for the clarification. Learned something new! I think it’s my lack of JavaScript knowledge . I am used the having to specifically define the data type of variables and not being able to combine variables with non-matching data types (like strings and integers in numeric calculations).
I’m trying to get my head around the functionality of your screenshot:
The first card returns the temperature without decimals, the devide part is superfluous when you multiply the result with the same value again.
The second card returns the “temperature without decimals” as temperature with 2 decimals.
What do you expect to change with the value from the temperature tag?
Just out of curiosity
Thanks for taking the time.
My floor heating system (Controme Smart Heating OS) is taking external temperature only if they are valid, based on the following rule:
Due to internal filters, Smart-Heat-OS only accepts temperatures (or humidity levels) that are divisible by 0.125. In addition, the API is limited to two decimal places, i.e., when transferring values with three decimal places, please remove the last digit (e.g., 22.0, 22.12, 22.5, 22.62, 22.75, etc.)
So the purpose of the flow is to get every temperature from my externals sensors as near as possible so that the Controme api will accept it by value and format.
Addition: Even if there is a value without decimals sometime the API is not accepting it without 2 decimals (,00). Strange thing…
I think I hear you.
So the API needs 2.00 as value and doesn’t always respond to a value 2?
That’s very well possible, but in the end it should accept integers (no decimals) imho.
round(12.12345 ,2) rounds to 12.12
but round(12 ,2) rounds to 12, not to 12.00
So you add the 2 zeros with this card in that case?
Thanks! While you have a hunch about a not stable operation:
Are you aware of the “error output” of adv flow cards? These even provide for an [Error] tag, which you can use in notification cards
The divide function can be replaced by / by the way
I think I’ve got it.
Each temperature is converted to a multiple of 0.125. Then it is truncated after the second decimal and always passed to the API with two decimal places, even if it is a whole number.
The external room temperatures now seems to be as near as possible with the given API of my Controme.
Maybe its me that is doing something wrong, but when I update a varible with a BLL Expression, the value within the app gets updated when viewing from inside the app setting, but the same variable that I access from a flow does not update.
After executing the flow, the vaiable mqtt gets updated to 2 when viewing from inside the app, but still shows as when viewing from the flow variable list.