• MattFox

    @phildunlap said in /v1/point-values PUT not updating in datasources other than virtual:

    The issue with the poll class it will not work as an abstract class

    Ah that's where I was going wrong! I think I was having issues with it compiling which is why I threw that unnecessary abstract in front... Thanks Phil, definitely feeling like a prized pillock today!

    May tomorrow go better?

    Fox

    posted in User help read more
  • MattFox

    @terrypacker said in Mango API POST /rest/v2/point-values - Import Point Values:

    The git issue that was closed was because the task was too overwhelming and not high enough priority.

    Apologies Terry, I was unaware what a cluster#$%^ this was. Thank you for your assistance with this, I'll get onto to having a read and will see if I can be of some assistance

    Fox

    posted in User help read more
  • MattFox

    Thanks for your help with this Phil!

    import com.infiniteautomation.datafilesource.rt.AbstractPollClass;
    import com.infiniteautomation.datafilesource.rt.PollClassInvoker;
    
    import com.serotonin.m2m2.rt.dataImage.DataPointRT;
    import com.serotonin.m2m2.rt.dataImage.PointValueTime;
    import com.serotonin.m2m2.rt.dataImage.SetPointSource;
    
    public abstract class PutPollClass extends AbstractPollClass {
    	/* @Override
    	public abstract void run(long time, PollClassInvoker invoker, String[] arguments); */
    	
    	 @Override
    	public boolean setPointValueImpl(DataPointRT dataPoint, PointValueTime valueTime,SetPointSource source) {
    		return true;
    	} 
    }
    

    Is the poll class data code.

    I'm using the API with an admin bearer token for simplicity. Should I take the login API route instead?

    What is the logging type of your points?

    "loggingType":"ALL",

    You would have to delete the old, import the new, and then run the SQL update statements to set the ID based on the XID such that old data wasn't lost. So, possible by maybe not trivial.

    So stupid question... By deleting means I'd still need to backup my data right? Or do you mean calling a DELETE FROM ... SQL query? Ah no wait I see now, you use the id to link point values to the datapoint, not the XID. Gotta admit I do like that. Will be good to get this sorted asap as data hasn't come in for two days now.

    posted in User help read more
  • MattFox

    Morning All,

    I've got data coming into my API which I'm relaying into mango after parsing the data.
    Problem is the points are not updating. These points are in datafile datasources, are 'settable' and are still not updating in mango, despite the 201 Created status response.

    The system sending this data is dropping their FTP uploads in favour of HTTP posts.
    The other issue is despite adding a poll class as suggested by Phil I'm still not triggering these updates.
    Any advice would be hugely appreciated and I'd be rather grateful.
    Am still on 3.5.6 - this may have to change at some point but I'll likely need some advice on going about this and not destroying my production install..

    Fox

    EDIT: Alternatively, how hard would it be to convert the Data File datasources into Virtual datasources? If I could manage that, it would save a lot of fluff.

    posted in User help read more
  • MattFox

    Thanks gentlemen, hugely appreciated.
    Rather than wait for 3.7 (I'm still on 3.5.6 due to it being a production server and 3.6 has fair number of alterations), would it be asking too much for a copy of all the required model data for the APIs?
    Just as a means to refer to as I doubt I'll be stopping here with the API. Longterm goal is to bring everything outside of mango and fully rely on the API to do all my data handling

    Fox

    posted in User help read more
  • MattFox

    @francisco-salinas
    If you have a copy of the source you're trying to parse from, use regexr.com and work from that to create your RegExp string.
    The Cerro Patacón should be part of the text, not a variable. I think there's a lot of detail missing here that you've not made clear.

    posted in How-To read more
  • MattFox

    @francisco-salinas said in HTTP Retriever - Value RegEx works whit accent:

    <tr><td><span>Cerro Patacón</span></td><td><span>(.?)</span></td></tr>

    If that's the case:

    <tr><td><span>Cerro Patacón<\/span><\/td><td><span>(.?)<\/span><\/td><\/tr>
    

    posted in How-To read more
  • MattFox

    The following characters have special meaning, and should be preceded by a \ (backslash) to represent a literal character:
    +*?^$.[]{}()|/

    So your

    <tr><td><span>(Cerro Patacón)</span></td><td><span>(.*?)</span></td></tr>
    

    Should be

    <tr><td><span>\(Cerro Patacón\)</span></td><td><span>(.*?)</span></td></tr>
    

    posted in How-To read more
  • MattFox

    Many thanks Phil, you'll see a lot of the docs have the same exact model in them. Is it something that can be easily rectified?

    Fox

    posted in User help read more
  • MattFox

    My suggestion would be saving into an alphanumeric point that triggers a scripted datasource. Parse the information provided and create/set separate virtual datapoints with it. You can affix the virtual points with tags (ideal for your device id) or an xid of your choice to make it easier to select and pull data for display.
    IMO, keep it generic and dynamic if you can. Gives you more breathing room for future amendments.

    Edit: Another thought. If you're going to use a basic application to handle the incoming data you can draw on the mango api to make your points on the fly if an insertion fails.

    posted in Mango Automation general Discussion read more